From 4724f7a2c137ba5357634aee1eebc1b1c28959f9 Mon Sep 17 00:00:00 2001 From: jetz Date: Mon, 7 Jun 2021 14:57:29 +0800 Subject: [PATCH] fix: start auto loading policy for SyncedEnforcer Signed-off-by: jetz --- casbin/synced_enforcer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/casbin/synced_enforcer.py b/casbin/synced_enforcer.py index 61130128..5f408766 100644 --- a/casbin/synced_enforcer.py +++ b/casbin/synced_enforcer.py @@ -49,6 +49,7 @@ def start_auto_load_policy(self, interval): return self._auto_loading.value = True self._auto_loading_thread = threading.Thread(target=self._auto_load_policy, args=[interval], daemon=True) + self._auto_loading_thread.start() def stop_auto_load_policy(self): """stops the thread started by start_auto_load_policy""" @@ -577,4 +578,4 @@ def remove_named_grouping_policies(self,ptype,rules): return self._e.remove_named_grouping_policies(ptype,rules) def build_incremental_role_links(self, op, ptype, rules): - self.get_model().build_incremental_role_links(self.get_role_manager(), op, "g", ptype, rules) \ No newline at end of file + self.get_model().build_incremental_role_links(self.get_role_manager(), op, "g", ptype, rules)