mirror of
https://github.com/fluencelabs/redis
synced 2025-06-13 01:01:22 +00:00
dict.c: added optional callback to dictEmpty().
Redis hash table implementation has many non-blocking features like incremental rehashing, however while deleting a large hash table there was no way to have a callback called to do some incremental work. This commit adds this support, as an optiona callback argument to dictEmpty() that is currently called at a fixed interval (one time every 65k deletions).
This commit is contained in:
@ -782,7 +782,7 @@ void readSyncBulkPayload(aeEventLoop *el, int fd, void *privdata, int mask) {
|
||||
}
|
||||
redisLog(REDIS_NOTICE, "MASTER <-> SLAVE sync: Flushing old data");
|
||||
signalFlushedDb(-1);
|
||||
emptyDb();
|
||||
emptyDb(NULL);
|
||||
/* Before loading the DB into memory we need to delete the readable
|
||||
* handler, otherwise it will get called recursively since
|
||||
* rdbLoad() will call the event loop to process events from time to
|
||||
@ -1445,7 +1445,7 @@ void replicationScriptCacheInit(void) {
|
||||
* to reclaim otherwise unused memory.
|
||||
*/
|
||||
void replicationScriptCacheFlush(void) {
|
||||
dictEmpty(server.repl_scriptcache_dict);
|
||||
dictEmpty(server.repl_scriptcache_dict,NULL);
|
||||
listRelease(server.repl_scriptcache_fifo);
|
||||
server.repl_scriptcache_fifo = listCreate();
|
||||
}
|
||||
|
Reference in New Issue
Block a user