pycasbin / django-orm-adapter

Django ORM Adapter for PyCasbin
https://github.com/casbin/pycasbin
Apache License 2.0
29 stars 19 forks source link

Psql watcher setup #31

Open pradeepranwa1 opened 4 days ago

pradeepranwa1 commented 4 days ago

I am using mutiple gunicorn workers each workers creates its own enforcer and in memory data, equal number of watchers are created, but on change in db only a single watcher is triggered mutiple times .

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=BANK_CONNECT_APIS_PG_PASSWORD, dbname=BANK_CONNECT_APIS_PG_DBNAME, channel_name=channel_name)

CASBIN_WATCHER = watcher

casbin-bot commented 4 days ago

@techoner @Nekotoxin

pradeepranwa1 commented 4 days ago

sorry any one random watcher is triggered and in memory data of that one worker is updated, others workers still have older data