Skip to content

Commit

Permalink
fix: forgot to get postgres conn from pool
Browse files Browse the repository at this point in the history
  • Loading branch information
vjeeva authored Feb 2, 2024
1 parent ea455e1 commit da28ed8
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions pgbelt/util/pglogical.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,14 @@ async def configure_replication_set(
Add each table in the given list to the default replication set
"""
logger.info(f"Creating new replication set 'pgbelt'")
try:
await conn.execute(
"SELECT pglogical.create_replication_set('pgbelt');"
)
logger.debug(f"{table} added to default replication set")
except Exception as e:
logger.debug(f"Could not create replication set 'pgbelt': {e}")
async with pool.acquire() as conn:
try:
await conn.execute(
"SELECT pglogical.create_replication_set('pgbelt');"
)
logger.debug(f"{table} added to default replication set")
except Exception as e:
logger.debug(f"Could not create replication set 'pgbelt': {e}")

logger.info(f"Configuring default replication set with tables: {tables}")
for table in tables:
Expand Down

0 comments on commit da28ed8

Please sign in to comment.