MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / processModuleLoadingProgressEvent

Function processModuleLoadingProgressEvent

src/module.cpp:8561–8580  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8559}
8560
8561void processModuleLoadingProgressEvent(int is_aof) {
8562 long long now = g_pserver->ustime;
8563 static long long next_event = 0;
8564 if (now >= next_event) {
8565 /* Fire the loading progress modules end event. */
8566 int progress = -1;
8567 if (g_pserver->loading_total_bytes)
8568 progress = (g_pserver->loading_loaded_bytes<<10) / g_pserver->loading_total_bytes;
8569 RedisModuleLoadingProgressV1 fi = {REDISMODULE_LOADING_PROGRESS_VERSION,
8570 g_pserver->hz,
8571 progress};
8572 moduleFireServerEvent(REDISMODULE_EVENT_LOADING_PROGRESS,
8573 is_aof?
8574 REDISMODULE_SUBEVENT_LOADING_PROGRESS_AOF:
8575 REDISMODULE_SUBEVENT_LOADING_PROGRESS_RDB,
8576 &fi);
8577 /* decide when the next event should fire. */
8578 next_event = now + 1000000 / g_pserver->hz;
8579 }
8580}
8581
8582/* When a module key is deleted (in dbAsyncDelete/dbSyncDelete/dbOverwrite), it
8583* will be called to tell the module which key is about to be released. */

Callers 2

rdbLoadProgressCallbackFunction · 0.85
loadAppendOnlyFileFunction · 0.85

Calls 1

moduleFireServerEventFunction · 0.85

Tested by

no test coverage detected