Skip to content

Commit

Permalink
Merge pull request #376 from rustprooflabs/reduced-conns-test
Browse files Browse the repository at this point in the history
Updates for latest osm2pgsql - reducing connections to Postgres
  • Loading branch information
rustprooflabs authored Feb 10, 2024
2 parents f876b72 + 3224da2 commit 0afd698
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ FROM postgis/postgis:16-3.4
LABEL maintainer="PgOSM Flex - https://github.com/rustprooflabs/pgosm-flex"

ARG OSM2PGSQL_BRANCH=master
ARG OSM2PGSQL_REPO=https://github.com/osm2pgsql-dev/osm2pgsql.git


RUN apt-get update \
# Removed upgrade per https://github.com/rustprooflabs/pgosm-flex/issues/322
Expand Down Expand Up @@ -34,7 +36,7 @@ RUN luarocks install luasql-postgres PGSQL_INCDIR=/usr/include/postgresql/


WORKDIR /tmp
RUN git clone --depth 1 --branch $OSM2PGSQL_BRANCH https://github.com/openstreetmap/osm2pgsql.git \
RUN git clone --depth 1 --branch $OSM2PGSQL_BRANCH $OSM2PGSQL_REPO \
&& mkdir osm2pgsql/build \
&& cd osm2pgsql/build \
&& cmake .. -D USE_PROJ_LIB=6 \
Expand Down
8 changes: 4 additions & 4 deletions docker/pgosm_flex.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ def run_replication_update(skip_nested, flex_path):
osm2pgsql-replication update -d $PGOSM_CONN \
-- \
--output=flex --style=./run.lua \
--slim \
-d $PGOSM_CONN
"""
--slim
"""

update_cmd = update_cmd.replace('-d $PGOSM_CONN', f'-d {conn_string}')
returncode = helpers.run_command_via_subprocess(cmd=update_cmd.split(),
cwd=flex_path,
Expand Down Expand Up @@ -422,7 +422,7 @@ def run_osm2pgsql(osm2pgsql_command, flex_path, debug):
"""
logger = logging.getLogger('pgosm-flex')
logger.info('Running osm2pgsql')

returncode = helpers.run_command_via_subprocess(cmd=osm2pgsql_command.split(),
cwd=flex_path,
print=True)
Expand Down

0 comments on commit 0afd698

Please sign in to comment.