Closed erichulburd closed 4 years ago
Why do you call Update()
? The example to follow is: https://github.com/billcobbler/casbin-redis-watcher#simple-example
Update()
is kind of internal function and is not expected to be called by users.
Hey @erichulburd,
You can easily avoid this by passing the NewWatcher the option IgnoreSelf(true)
.
@hsluoyz I realize that - I was referring to the Update
call in SavePolicy
@billcobbler Thanks, exactly what I was looking for.
Calling
watcher.Update
will result in the publishing instances to invoke their callback function . You can test this by running a single node with a watcher, and you'll see the callback function fired after saving a policy.Is there any easy way out of this inefficiency? I realize this may be an issue for the actual Casbin repository, but I'm wondering if there are any Redis limitations that would prevent improved behavior.