Skip to content

Commit 96ea26d

Browse files
committed
feat: adds explit stop method to stop the watcher
1 parent d0098d7 commit 96ea26d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

postgresql_watcher/watcher.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ def start(
124124
raise PostgresqlWatcherChannelSubscriptionTimeoutError(timeout)
125125
sleep(1 / 1000) # wait for 1 ms
126126

127+
def stop(self):
128+
self._cleanup_connections_and_processes()
129+
127130
def _cleanup_connections_and_processes(self) -> None:
128131
# Clean up potentially existing Connections and Processes
129132
if self.parent_conn is not None:

0 commit comments

Comments
 (0)