Hello , anyone used psql watcher with django orm adaptor
i guess watcher is not working in django
@deleted_user can you send a github issue with more details?
@hsluoyz raised on github psql watcher repo
@hsluoyz hey one more thing is there any support for using same redis cache for all workers instead of in memory and psql for permanent storage by this way i won’t require watcher
send github issue
I am using mutiple gunicorn workers
INSTALLED_APPS = [
'casbin_adapter.apps.CasbinAdapterConfig'
]
CASBIN_MODEL = os.path.join("finbox_dashboard/casbin_middleware/authz_model.conf")
watcher = PostgresqlWatcher(host=BANK_CONNECT_APIS_PG_HOST_URL, port=BANK_CONNECT_APIS_PG_PORT,
user=BANK_CONNECT_APIS_PG_USER, password=***, dbname=BANK_CONNECT_APIS_PG_DBNAME, enforcer=enforcer)
watcher.set_update_callback(enforcer.load_policy)
enforcer.set_watcher(watcher)
using this setup django migration and casbin is working but watcher is not working
for watcher listen/notify service is created in db on any change in casbin policy worker notifies db and other workers are polling that change, but i observed a single worker(single instance of enforcer) fetches all triggers and apart from that set_update_callback is never called
i need watcher even when using single server because of gunicorn workers spinning up different django app
send github issue
@hsluoyz i have shared details over github issue
@hsluoyz i have raised pr for above issue
Join the conversation
Sign up to reply, like and follow topics.
Suggested Topics
Want to read more? Browse other topics in Casbin or view latest topics.
