Skip to content

Commit

Permalink
Log _critical_termination_listener must take args
Browse files Browse the repository at this point in the history
  • Loading branch information
janbjorge committed Feb 19, 2024
1 parent 674b5a3 commit 7fbef3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "PGCacheWatch"
description = "A Python library for real-time PostgreSQL event-driven cache invalidation, leveraging existing database infrastructure"
readme = "README.md"
requires-python = ">=3.10"
version = "0.0.4"
version = "0.0.5"
license = { text = "Apache 2.0" }
authors = [{ name = "janbjorge"}]

Expand Down
4 changes: 2 additions & 2 deletions src/pgcachewatch/listeners.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from . import models


def _critical_termination_listener() -> None:
def _critical_termination_listener(*_: object, **__: object) -> None:
# Must be defined in the global namespace, as ayncpg keeps
# a set of functions to call. This this will now happen once as
# all instance will point to the same function.
Expand Down Expand Up @@ -61,7 +61,7 @@ async def create(
max_latency=max_latency,
_called_by_create=True,
)
me._pg_connection.add_termination_listener(_critical_termination_listener) # type: ignore[arg-type]
me._pg_connection.add_termination_listener(_critical_termination_listener)
await me._pg_connection.add_listener(me._pg_channel, me.parse_and_put) # type: ignore[arg-type]

return me
Expand Down

0 comments on commit 7fbef3e

Please sign in to comment.