[Chore/Refactor] Use centralized naive_utc_now for UTC datetime operations (#24352)
Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import datetime
|
||||
import logging
|
||||
import time
|
||||
|
||||
@@ -8,6 +7,7 @@ from celery import shared_task # type: ignore
|
||||
from core.indexing_runner import DocumentIsPausedError, IndexingRunner
|
||||
from core.rag.index_processor.index_processor_factory import IndexProcessorFactory
|
||||
from extensions.ext_database import db
|
||||
from libs.datetime_utils import naive_utc_now
|
||||
from models.dataset import Dataset, Document, DocumentSegment
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ def document_indexing_update_task(dataset_id: str, document_id: str):
|
||||
return
|
||||
|
||||
document.indexing_status = "parsing"
|
||||
document.processing_started_at = datetime.datetime.now(datetime.UTC).replace(tzinfo=None)
|
||||
document.processing_started_at = naive_utc_now()
|
||||
db.session.commit()
|
||||
|
||||
# delete all document segment and index
|
||||
|
Reference in New Issue
Block a user