mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 15:31:05 +08:00
Add REDIS zcard (#14316)
### What problem does this PR solve? As description. ### Type of change - [x] Refactoring
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user