Skip to content

Commit

Permalink
Add POSTGRES_MASTER_CONNECTIONS
Browse files Browse the repository at this point in the history
  • Loading branch information
cao committed Jul 23, 2016
1 parent 6bd7445 commit a52c039
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ POSTGRES_DATABASE_PASSWORD=""
POSTGRES_DATABASE_NAME="farnsworth_test"
POSTGRES_MASTER_SERVICE_HOST="postgres"
POSTGRES_MASTER_SERVICE_PORT=5432
POSTGRES_MASTER_CONNECTIONS=2
# POSTGRES_USE_SLAVES=true
# POSTGRES_SLAVE_SERVICE_HOST="localhost"
# POSTGRES_SLAVE_SERVICE_PORT=5432
4 changes: 2 additions & 2 deletions farnsworth/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class RetryPooledPostgresqlExtDatabase(PooledPostgresqlExtDatabase, RetryOperati
register_hstore=False,
autocommit=True,
autorollback=True,
max_connections=20,
max_connections=os.environ.get('POSTGRES_MASTER_CONNECTIONS', 2),
stale_timeout=60
)

Expand All @@ -37,7 +37,7 @@ class RetryPooledPostgresqlExtDatabase(PooledPostgresqlExtDatabase, RetryOperati
host=os.environ['POSTGRES_SLAVE_SERVICE_HOST'],
port=os.environ['POSTGRES_SLAVE_SERVICE_PORT'],
register_hstore=False,
max_connections=40,
max_connections=os.environ.get('POSTGRES_SLAVE_CONNECTIONS', 2),
stale_timeout=60
)
else:
Expand Down

0 comments on commit a52c039

Please sign in to comment.