optimize the check of kill pubsub clients after modifying ACL rules (#12457)
if there are no subscribers, we can ignore the operation
This commit is contained in:
parent
8226f39fb2
commit
1b6bdff48d
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user