Skip to content

Commit

Permalink
Aiopg: pass original kwargs to psycopg2
Browse files Browse the repository at this point in the history
Fixes #908
  • Loading branch information
ewjoachim committed Jan 23, 2024
1 parent 2442922 commit 7302b6a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions procrastinate/contrib/aiopg/aiopg_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,20 +143,20 @@ def __init__(
self._pool_externally_set: bool = False
self.json_dumps = json_dumps
self.json_loads = json_loads
self._original_kwargs = kwargs
self._pool_args = self._adapt_pool_args(kwargs, json_loads)
self._lock: asyncio.Lock | None = None
self._sync_connector: connector.BaseConnector | None = None

def get_sync_connector(self) -> connector.BaseConnector:
if self._pool:
return self
args_copy = dict(self._pool_args)
args_copy.pop("on_connect", None)

if self._sync_connector is None:
self._sync_connector = psycopg2_connector.Psycopg2Connector(
json_dumps=self.json_dumps,
json_loads=self.json_loads,
**args_copy,
**dict(self._original_kwargs),
)
return self._sync_connector

Expand Down

0 comments on commit 7302b6a

Please sign in to comment.