MCPcopy Create free account
hub / github.com/F-Stack/f-stack / processModuleLoadingProgressEvent

Function processModuleLoadingProgressEvent

app/redis-6.2.6/src/module.c:8362–8381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8360}
8361
8362void processModuleLoadingProgressEvent(int is_aof) {
8363 long long now = server.ustime;
8364 static long long next_event = 0;
8365 if (now >= next_event) {
8366 /* Fire the loading progress modules end event. */
8367 int progress = -1;
8368 if (server.loading_total_bytes)
8369 progress = (server.loading_loaded_bytes<<10) / server.loading_total_bytes;
8370 RedisModuleLoadingProgressV1 fi = {REDISMODULE_LOADING_PROGRESS_VERSION,
8371 server.hz,
8372 progress};
8373 moduleFireServerEvent(REDISMODULE_EVENT_LOADING_PROGRESS,
8374 is_aof?
8375 REDISMODULE_SUBEVENT_LOADING_PROGRESS_AOF:
8376 REDISMODULE_SUBEVENT_LOADING_PROGRESS_RDB,
8377 &fi);
8378 /* decide when the next event should fire. */
8379 next_event = now + 1000000 / server.hz;
8380 }
8381}
8382
8383/* When a module key is deleted (in dbAsyncDelete/dbSyncDelete/dbOverwrite), it
8384* 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