add stream chat (#811)
### What problem does this PR solve? #709 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@@ -43,6 +43,9 @@ class ESConnection:
|
||||
v = v["number"].split(".")[0]
|
||||
return int(v) >= 7
|
||||
|
||||
def health(self):
|
||||
return dict(self.es.cluster.health())
|
||||
|
||||
def upsert(self, df, idxnm=""):
|
||||
res = []
|
||||
for d in df:
|
||||
|
||||
@@ -34,6 +34,16 @@ class RAGFlowMinio(object):
|
||||
del self.conn
|
||||
self.conn = None
|
||||
|
||||
def health(self):
|
||||
bucket, fnm, binary = "_t@@@1", "_t@@@1", b"_t@@@1"
|
||||
if not self.conn.bucket_exists(bucket):
|
||||
self.conn.make_bucket(bucket)
|
||||
r = self.conn.put_object(bucket, fnm,
|
||||
BytesIO(binary),
|
||||
len(binary)
|
||||
)
|
||||
return r
|
||||
|
||||
def put(self, bucket, fnm, binary):
|
||||
for _ in range(3):
|
||||
try:
|
||||
|
||||
@@ -44,6 +44,10 @@ class RedisDB:
|
||||
logging.warning("Redis can't be connected.")
|
||||
return self.REDIS
|
||||
|
||||
def health(self, queue_name):
|
||||
self.REDIS.ping()
|
||||
return self.REDIS.xinfo_groups(queue_name)[0]
|
||||
|
||||
def is_alive(self):
|
||||
return self.REDIS is not None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user