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

Function moduleUnregisterFilters

src/module.cpp:7539–7555  ·  view source on GitHub ↗

Unregister all filters registered by a module. * This is called when a module is being unloaded. * * Returns the number of filters unregistered. */

Source from the content-addressed store, hash-verified

7537 *
7538 * Returns the number of filters unregistered. */
7539int moduleUnregisterFilters(RedisModule *module) {
7540 listIter li;
7541 listNode *ln;
7542 int count = 0;
7543
7544 listRewind(module->filters,&li);
7545 while((ln = listNext(&li))) {
7546 RedisModuleCommandFilter *filter = (RedisModuleCommandFilter*)ln->value;
7547 listNode *ln = listSearchKey(moduleCommandFilters,filter);
7548 if (ln) {
7549 listDelNode(moduleCommandFilters,ln);
7550 count++;
7551 }
7552 zfree(filter);
7553 }
7554 return count;
7555}
7556
7557/* --------------------------------------------------------------------------
7558 * ## Module Command Filter API

Callers 1

moduleUnloadFunction · 0.85

Calls 5

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

Tested by

no test coverage detected