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

Function moduleLoadFromQueue

src/module.cpp:8692–8708  ·  view source on GitHub ↗

Load all the modules in the g_pserver->loadmodule_queue list, which is * populated by `loadmodule` directives in the configuration file. * We can't load modules directly when processing the configuration file * because the server must be fully initialized before loading modules. * * The function aborts the server on errors, since to start with missing * modules is not considered sane: client

Source from the content-addressed store, hash-verified

8690 * given commands, loading AOF also may need some modules to exist, and
8691 * if this instance is a replica, it must understand commands from master. */
8692void moduleLoadFromQueue(void) {
8693 listIter li;
8694 listNode *ln;
8695
8696 listRewind(g_pserver->loadmodule_queue,&li);
8697 while((ln = listNext(&li))) {
8698 struct moduleLoadQueueEntry *loadmod = (moduleLoadQueueEntry*)ln->value;
8699 if (moduleLoad(loadmod->path,(void **)loadmod->argv,loadmod->argc)
8700 == C_ERR)
8701 {
8702 serverLog(LL_WARNING,
8703 "Can't load module from %s: server aborting",
8704 loadmod->path);
8705 exit(1);
8706 }
8707 }
8708}
8709
8710void moduleFreeModuleStructure(struct RedisModule *module) {
8711 listRelease(module->types);

Callers 1

mainFunction · 0.85

Calls 4

listRewindFunction · 0.85
listNextFunction · 0.85
moduleLoadFunction · 0.85
serverLogFunction · 0.85

Tested by

no test coverage detected