From d95332bc9ec591f2649b1d9e0b37aec77056a882 Mon Sep 17 00:00:00 2001 From: Daniele Briggi Date: Fri, 24 May 2024 10:46:35 +0000 Subject: [PATCH] Workflow triggers --- .github/workflows/deploy.yaml | 2 ++ src/sqlitecloud/driver.py | 6 +++--- src/tests/integration/test_pubsub.py | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index b499093..1ca6d6f 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -5,6 +5,8 @@ name: Test and Release on: push: + branches: + - main pull_request: workflow_dispatch: diff --git a/src/sqlitecloud/driver.py b/src/sqlitecloud/driver.py index 15ae0b8..c1843dd 100644 --- a/src/sqlitecloud/driver.py +++ b/src/sqlitecloud/driver.py @@ -186,12 +186,12 @@ def _internal_pubsub_thread(self, connection: SQCloudConnect) -> None: ready_to_read, _, errors = select.select( [connection.pubsub_socket], [], [] ) - # eg, no data to read - if len(ready_to_read) == 0: - continue # eg, if the socket is closed if len(errors) > 0: break + # eg, no data to read + if len(ready_to_read) == 0: + continue data = connection.pubsub_socket.recv(blen) if not data: diff --git a/src/tests/integration/test_pubsub.py b/src/tests/integration/test_pubsub.py index 4b6cba5..fd1ba14 100644 --- a/src/tests/integration/test_pubsub.py +++ b/src/tests/integration/test_pubsub.py @@ -129,13 +129,13 @@ def assert_callback(conn, result, data): pubsub2 = SqliteCloudPubSub() pubsub2.notify_channel(connection2, channel, "message-in-a-bottle") + client.disconnect(connection2) + # wait for callback to be called flag.wait(30) assert callback_called - client.disconnect(connection2) - def test_listen_table_for_update(self, sqlitecloud_connection): connection, client = sqlitecloud_connection