Refactor: keep timestamp consistency (#12279)

### What problem does this PR solve?

keep timestamp consistency

### Type of change

- [x] Refactoring
This commit is contained in:
Stephen Hu
2025-12-29 12:02:43 +08:00
committed by GitHub
parent f9619defcc
commit 9883c572cd
2 changed files with 9 additions and 7 deletions

View File

@ -65,6 +65,7 @@ class EvaluationService(CommonService):
(success, dataset_id or error_message)
"""
try:
timestamp= current_timestamp()
dataset_id = get_uuid()
dataset = {
"id": dataset_id,
@ -73,8 +74,8 @@ class EvaluationService(CommonService):
"description": description,
"kb_ids": kb_ids,
"created_by": user_id,
"create_time": current_timestamp(),
"update_time": current_timestamp(),
"create_time": timestamp,
"update_time": timestamp,
"status": StatusEnum.VALID.value
}

View File

@ -169,11 +169,12 @@ class PipelineOperationLogService(CommonService):
operation_status=operation_status,
avatar=avatar,
)
log["create_time"] = current_timestamp()
log["create_date"] = datetime_format(datetime.now())
log["update_time"] = current_timestamp()
log["update_date"] = datetime_format(datetime.now())
timestamp = current_timestamp()
datetime_now = datetime.now()
log["create_time"] = timestamp
log["create_date"] = datetime_format(datetime_now)
log["update_time"] = timestamp
log["update_date"] = datetime_format(datetime_now)
with DB.atomic():
obj = cls.save(**log)