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

Function moduleUnregisterUsedAPI

src/module.cpp:7518–7533  ·  view source on GitHub ↗

Remove the specified module as an user of APIs of ever other module. * This is usually called when a module is unloaded. * * Returns the number of modules this module was using APIs from. */

Source from the content-addressed store, hash-verified

7516 *
7517 * Returns the number of modules this module was using APIs from. */
7518int moduleUnregisterUsedAPI(RedisModule *module) {
7519 listIter li;
7520 listNode *ln;
7521 int count = 0;
7522
7523 listRewind(module->usingMods,&li);
7524 while((ln = listNext(&li))) {
7525 RedisModule *used = (RedisModule*)ln->value;
7526 listNode *ln = listSearchKey(used->usedby,module);
7527 if (ln) {
7528 listDelNode(used->usedby,ln);
7529 count++;
7530 }
7531 }
7532 return count;
7533}
7534
7535/* Unregister all filters registered by a module.
7536 * This is called when a module is being unloaded.

Callers 2

moduleLoadFunction · 0.85
moduleUnloadFunction · 0.85

Calls 4

listRewindFunction · 0.85
listNextFunction · 0.85
listSearchKeyFunction · 0.85
listDelNodeFunction · 0.85

Tested by

no test coverage detected