Skip to content

Commit

Permalink
Update progress time info (#4193)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

Ignore the millisecond and microsecond value.

### Type of change

- [x] Refactoring

Signed-off-by: jinhai <haijin.chn@gmail.com>
  • Loading branch information
JinHai-CN authored Dec 23, 2024
1 parent a9fd606 commit d030b4a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/db/services/task_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def get_task(cls, task_id):
if not docs:
return None

msg = f"\n{datetime.now().strftime('%H:%M:%S.%f')} Task has been received."
msg = f"\n{datetime.now().strftime('%H:%M:%S')} Task has been received."
prog = random.random() / 10.0
if docs[0]["retry_count"] >= 3:
msg = "\nERROR: Task is abandoned after 3 times attempts."
Expand Down
2 changes: 1 addition & 1 deletion rag/svr/task_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def set_progress(task_id, from_page=0, to_page=-1, prog=None, msg="Processing...
if msg:
msg = f"Page({from_page + 1}~{to_page + 1}): " + msg
if msg:
msg = datetime.now().strftime("%H:%M:%S.%f") + " " + msg
msg = datetime.now().strftime("%H:%M:%S") + " " + msg
d = {"progress_msg": msg}
if prog is not None:
d["progress"] = prog
Expand Down

0 comments on commit d030b4a

Please sign in to comment.