mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
Move signalFlushedDb() into a better place.
Now that the call also invalidates client side caching slots, it is important that after an internal flush operation we both send the notifications to the clients and, at the same time, are able to reclaim the memory of the tracking table. This may even fix a few edge cases related to MULTI/EXEC + WATCH during resync, not sure, but in general looks more correct.
This commit is contained in:
parent
7d3992a80a
commit
436d02dd7b
3
src/db.c
3
src/db.c
@ -378,6 +378,7 @@ long long emptyDbGeneric(redisDb *dbarray, int dbnum, int flags, void(callback)(
|
||||
}
|
||||
}
|
||||
if (dbnum == -1) flushSlaveKeysWithExpireList();
|
||||
signalFlushedDb(dbnum);
|
||||
return removed;
|
||||
}
|
||||
|
||||
@ -453,7 +454,6 @@ void flushdbCommand(client *c) {
|
||||
int flags;
|
||||
|
||||
if (getFlushCommandFlags(c,&flags) == C_ERR) return;
|
||||
signalFlushedDb(c->db->id);
|
||||
server.dirty += emptyDb(c->db->id,flags,NULL);
|
||||
addReply(c,shared.ok);
|
||||
}
|
||||
@ -465,7 +465,6 @@ void flushallCommand(client *c) {
|
||||
int flags;
|
||||
|
||||
if (getFlushCommandFlags(c,&flags) == C_ERR) return;
|
||||
signalFlushedDb(-1);
|
||||
server.dirty += emptyDb(-1,flags,NULL);
|
||||
addReply(c,shared.ok);
|
||||
if (server.rdb_child_pid != -1) killRDBChild();
|
||||
|
Loading…
Reference in New Issue
Block a user