| 347 | RedisModule_Assert(false); |
| 348 | } |
| 349 | static void PythonRequirementCtx_Free(PythonRequirementCtx* reqCtx){ |
| 350 | if(--reqCtx->refCount){ |
| 351 | return; |
| 352 | } |
| 353 | |
| 354 | PythonRequirementCtx_VerifyBasePath(reqCtx); |
| 355 | RedisGears_ExecuteCommand(NULL, "notice", "rm -rf '%s'", reqCtx->basePath); |
| 356 | if (reqCtx->isInRequirementsDict) { |
| 357 | Gears_dictDelete(RequirementsDict, reqCtx->installName); |
| 358 | } else if (reqCtx->isInstalled) { |
| 359 | // reinstall old requirement if exists |
| 360 | PythonRequirementCtx *oldReq = PythonRequirementCtx_Get(reqCtx->installName); |
| 361 | if (oldReq) { |
| 362 | PythonRequirementCtx_InstallRequirement(oldReq); |
| 363 | PythonRequirementCtx_Free(oldReq); |
| 364 | } |
| 365 | } |
| 366 | RG_FREE(reqCtx->installName); |
| 367 | RG_FREE(reqCtx->basePath); |
| 368 | if(reqCtx->wheels){ |
| 369 | for(size_t i = 0 ; i < array_len(reqCtx->wheels) ; i++){ |
| 370 | RG_FREE(reqCtx->wheels[i]); |
| 371 | } |
| 372 | array_free(reqCtx->wheels); |
| 373 | } |
| 374 | RG_FREE(reqCtx); |
| 375 | } |
| 376 | |
| 377 | static char* PythonStringArray_ToStr(void* wheel){ |
| 378 | char* str; |
no test coverage detected