fix: hash remove

This commit is contained in:
factosea 2024-07-15 16:32:32 +08:00
parent a5073355bb
commit ae67829b67
1 changed files with 3 additions and 1 deletions

View File

@ -1228,7 +1228,9 @@ static void checkRegexCache(void* param, void* tmrId) {
UsingRegex **ppUsingRegex = taosHashIterate(sRegexCache.regexHash, NULL);
while ((ppUsingRegex != NULL)) {
if (taosGetTimestampSec() - (*ppUsingRegex)->lastUsedTime > REGEX_CACHE_CLEAR_TIME) {
taosHashRemove(sRegexCache.regexHash, ppUsingRegex);
size_t len = 0;
char* key = (char*)taosHashGetKey(ppUsingRegex, &len);
taosHashRemove(sRegexCache.regexHash, key, len);
}
ppUsingRegex = taosHashIterate(sRegexCache.regexHash, ppUsingRegex);
}