mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
support monitoring task executor (#2069)
### What problem does this PR solve? #1383 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -379,11 +379,12 @@ def report_status():
|
||||
while True:
|
||||
try:
|
||||
obj = REDIS_CONN.get("TASKEXE")
|
||||
obj = json.load(obj)
|
||||
if not obj: obj = {}
|
||||
else: obj = json.load(obj)
|
||||
if id not in obj: obj[id] = []
|
||||
obj[id].append(timer()*1000)
|
||||
obj[id] = obj[id][:-60]
|
||||
REDIS_CONN.set_obj("TASKEXE", obj)
|
||||
obj[id] = obj[id][-60:]
|
||||
REDIS_CONN.set_obj("TASKEXE", obj, 60*2)
|
||||
except Exception as e:
|
||||
print("[Exception]:", str(e))
|
||||
time.sleep(60)
|
||||
|
||||
Reference in New Issue
Block a user