Unverified Commit 1b6bdff4 authored by zhaozhao.zz's avatar zhaozhao.zz Committed by GitHub
Browse files

optimize the check of kill pubsub clients after modifying ACL rules (#12457)

if there are no subscribers, we can ignore the operation
parent 8226f39f
......@@ -1859,6 +1859,12 @@ int ACLCheckAllPerm(client *c, int *idxptr) {
/* Check if the user's existing pub/sub clients violate the ACL pub/sub
* permissions specified via the upcoming argument, and kill them if so. */
void ACLKillPubsubClientsIfNeeded(user *new, user *original) {
/* Do nothing if there are no subscribers. */
if (!dictSize(server.pubsub_patterns) &&
!dictSize(server.pubsub_channels) &&
!dictSize(server.pubsubshard_channels))
return;
listIter li, lpi;
listNode *ln, *lpn;
robj *o;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment