Skip to content

Commit 8cc529c

Browse files
fix: Fix for more recent casbin versions and connection send fix (#12)
* Update requirements.txt Allow the watcher to be used with casbin versions more recent than 0.8.4. * Fixed subscriber send function Replaced call to process_con.put() with process_conn.send(). Trying to call .put() throws the error: AttributeError: 'Connection' object has no attribute 'put' (at least on MacOS)
1 parent 48001e0 commit 8cc529c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

postgresql_watcher/watcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def casbin_subscription(
3131
while conn.notifies:
3232
notify = conn.notifies.pop(0)
3333
print(f"Notify: {notify.payload}")
34-
process_conn.put(notify.payload)
34+
process_conn.send(notify.payload)
3535

3636

3737
class PostgresqlWatcher(object):

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
casbin==0.8.4
2-
psycopg2-binary==2.8.6
1+
casbin>=0.8.4
2+
psycopg2-binary==2.8.6

0 commit comments

Comments
 (0)