MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / _ShutdownEventHandler

Function _ShutdownEventHandler

src/module_event_handlers.c:337–363  ·  view source on GitHub ↗

Perform clean-up upon server shutdown.

Source from the content-addressed store, hash-verified

335
336// Perform clean-up upon server shutdown.
337static void _ShutdownEventHandler
338(
339 RedisModuleCtx *ctx,
340 RedisModuleEvent eid,
341 uint64_t subevent,
342 void *data
343) {
344 void RediSearch_CleanupModule();
345 if (!getenv("RS_GLOBAL_DTORS")) { // used only with sanitizer or valgrind
346 return;
347 }
348
349 // stop cron
350 Cron_Stop();
351
352 // stop threads before finalize GraphBLAS
353 ThreadPools_Destroy();
354
355 // server is shutting down, finalize GraphBLAS
356 GrB_finalize();
357
358 RedisModule_Log(ctx, "notice", "%s", "Clearing RediSearch resources on shutdown");
359 RediSearch_CleanupModule();
360
361 // free global variables
362 Globals_Free();
363}
364
365static void _ModuleLoadedHandler
366(

Callers

nothing calls this directly

Calls 4

Cron_StopFunction · 0.85
ThreadPools_DestroyFunction · 0.85
GrB_finalizeFunction · 0.85
Globals_FreeFunction · 0.85

Tested by

no test coverage detected