Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Refactor: keep timestamp consistency (#12279)

Stephen Hu9883c572cde9
diff --git a/api/db/services/evaluation_service.py b/api/db/services/evaluation_service.py
index c5a24176d4..3f523b1d8c 100644
--- a/api/db/services/evaluation_service.py
+++ b/api/db/services/evaluation_service.py
@@ -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
}
diff --git a/api/db/services/pipeline_operation_log_service.py b/api/db/services/pipeline_operation_log_service.py
index 9b344d0069..6858751ebb 100644
--- a/api/db/services/pipeline_operation_log_service.py
+++ b/api/db/services/pipeline_operation_log_service.py
@@ -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)