Add REDIS zcard (#14316)

### What problem does this PR solve?

As description.

### Type of change

- [x] Refactoring
This commit is contained in:
Wang Qi
2026-04-23 12:51:55 +08:00
committed by GitHub
parent aa4526266f
commit 224574831c

View File

@@ -284,6 +284,17 @@ class RedisDB:
self.__open__()
return 0
def zcard(self, key: str):
try:
res = self.REDIS.zcard(key)
return res
except Exception as e:
logging.warning(
f"RedisDB.zcard {key} got exception: {e}"
)
self.__open__()
return 0
def incrby(self, key: str, increment: int):
return self.REDIS.incrby(key, increment)