Skip to content

Commit

Permalink
reduce useless output, ignore duplicate at init
Browse files Browse the repository at this point in the history
  • Loading branch information
takb committed Feb 8, 2021
1 parent 4b8612e commit ce87cea
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,5 @@ ops_settings_docker*.yml
!ops_settings_docker_standalone.yml
docker-compose-*.yml
!docker-compose-standalone.yml

backup/*
2 changes: 1 addition & 1 deletion gunicorn_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
workers = 4
worker_class = 'gevent'
worker_connections = 1000
timeout = 30
timeout = 60
keepalive = 2
4 changes: 2 additions & 2 deletions openpoiservice/server/api/query_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def generate_category_stats(cls, query):

places_dict["places"]["total_count"] += poi_group.count

logger.info('Number of poi stats groups: {}'.format(len(places_dict)))
logger.debug('Number of poi stats groups: {}'.format(len(places_dict)))

return places_dict

Expand Down Expand Up @@ -262,6 +262,6 @@ def generate_geojson_features(cls, query, limit):

feature_collection = geojson.FeatureCollection(geojson_features, bbox=MultiPoint(lat_lngs).bounds)

logger.info("Amount of features {}".format(len(geojson_features)))
logger.debug("Amount of features {}".format(len(geojson_features)))

return feature_collection
6 changes: 6 additions & 0 deletions openpoiservice/server/db_import/parse_osm.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@ def save_buffer(self):
If running in update mode, delete all POIs with IDs in buffer first. Foreign key constraints in the database
handle deletion of related tags/categories.
"""

if not self.update_mode:
for poi in self.poi_objects:
if len(db.session.query(POIs).filter_by(osm_type=poi.osm_type, osm_id=poi.osm_id).all()) > 0:
self.update_mode = True

if self.update_mode:
for poi in self.poi_objects:
db.session.query(POIs).filter_by(osm_type=poi.osm_type, osm_id=poi.osm_id).delete()
Expand Down

0 comments on commit ce87cea

Please sign in to comment.