MCPcopy Create free account
hub / github.com/RedisGears/RedisGears / RedisGearsPy_ClearRequirements

Function RedisGearsPy_ClearRequirements

plugins/python/redisgears_python.c:7019–7038  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7017#define REDISGEARSPY_REQ_DATATYPE_VERSION 1
7018
7019static void RedisGearsPy_ClearRequirements(){
7020 PythonRequirementCtx** reqs = array_new(PythonRequirementCtx*, 10);
7021
7022 Gears_dictIterator *iter = Gears_dictGetIterator(RequirementsDict);
7023 Gears_dictEntry *entry = NULL;
7024 while((entry = Gears_dictNext(iter))){
7025 PythonRequirementCtx* req = Gears_dictGetVal(entry);
7026 // he can not directly release cause it will change the dict while iterating
7027 array_append(reqs, req);
7028 }
7029 Gears_dictReleaseIterator(iter);
7030
7031 for(size_t i = 0 ; i < array_len(reqs) ; ++i){
7032 Gears_dictDelete(RequirementsDict, reqs[i]->installName);
7033 reqs[i]->isInRequirementsDict = false;
7034 PythonRequirementCtx_Free(reqs[i]);
7035 }
7036
7037 array_free(reqs);
7038}
7039
7040static void RedisGearsPy_ClearAllData(){
7041 RedisGearsPy_ClearRequirements();

Callers 3

RedisGearsPy_CleanFunction · 0.85

Calls 7

Gears_dictGetIteratorFunction · 0.85
Gears_dictNextFunction · 0.85
array_lenFunction · 0.85
Gears_dictDeleteFunction · 0.85
array_freeFunction · 0.85

Tested by

no test coverage detected