Skip to content

Commit

Permalink
Use pools of size 1 instead of null pools
Browse files Browse the repository at this point in the history
  • Loading branch information
pnorman committed Feb 2, 2024
1 parent 7113373 commit 9bb5aee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tilekiln/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def load_server_config():
global tilesets
# Because the DB connection variables are passed as standard PG* vars,
# a plain ConnectionPool() will connect to the right DB
pool = psycopg_pool.NullConnectionPool()
pool = psycopg_pool.ConnectionPool(min_size=1, max_size=1)

storage = Storage(pool)
for tileset in storage.get_tilesets():
Expand Down Expand Up @@ -91,7 +91,7 @@ def load_live_config():
if "STORAGE_PGUSER" in os.environ:
storage_args["username"] = os.environ["STORAGE_PGUSER"]

storage_pool = psycopg_pool.NullConnectionPool(kwargs=storage_args)
storage_pool = psycopg_pool.ConnectionPool(min_size=1, max_size=1, kwargs=storage_args)
storage = Storage(storage_pool)

# Storing the tileset in the dict allows some commonalities in code later
Expand Down

0 comments on commit 9bb5aee

Please sign in to comment.