Skip to content

Commit

Permalink
Added time to progress message
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzhichang committed Dec 23, 2024
1 parent 85083ad commit d6c5baa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rag/svr/task_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

CONSUMER_NAME = "task_consumer_" + CONSUMER_NO
PAYLOAD: Payload | None = None
BOOT_AT = datetime.now().isoformat()
BOOT_AT = datetime.now().astimezone().isoformat(timespec="milliseconds")
PENDING_TASKS = 0
LAG_TASKS = 0

Expand Down Expand Up @@ -116,6 +116,7 @@ def set_progress(task_id, from_page=0, to_page=-1, prog=None, msg="Processing...
if to_page > 0:
if msg:
msg = f"Page({from_page + 1}~{to_page + 1}): " + msg
msg = datetime.now().astimezone().isoformat(timespec="milliseconds") + " " + msg
d = {"progress_msg": msg}
if prog is not None:
d["progress"] = prog
Expand Down Expand Up @@ -550,7 +551,7 @@ def report_status():
with mt_lock:
heartbeat = json.dumps({
"name": CONSUMER_NAME,
"now": now.isoformat(),
"now": now.astimezone().isoformat(timespec="milliseconds"),
"boot_at": BOOT_AT,
"pending": PENDING_TASKS,
"lag": LAG_TASKS,
Expand Down

0 comments on commit d6c5baa

Please sign in to comment.