| 7017 | #define REDISGEARSPY_REQ_DATATYPE_VERSION 1 |
| 7018 | |
| 7019 | static 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 | |
| 7040 | static void RedisGearsPy_ClearAllData(){ |
| 7041 | RedisGearsPy_ClearRequirements(); |
no test coverage detected