[Chore/Refactor] Use centralized naive_utc_now for UTC datetime operations (#24352)
Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
parent
295b47cbff
commit
da9af7b547
34 changed files with 153 additions and 150 deletions
|
|
@ -1,4 +1,3 @@
|
|||
import datetime
|
||||
import logging
|
||||
import time
|
||||
|
||||
|
|
@ -9,6 +8,7 @@ from core.indexing_runner import DocumentIsPausedError, IndexingRunner
|
|||
from core.rag.extractor.notion_extractor import NotionExtractor
|
||||
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
|
||||
from models.source import DataSourceOauthBinding
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ def document_indexing_sync_task(dataset_id: str, document_id: str):
|
|||
# check the page is updated
|
||||
if last_edited_time != page_edited_time:
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue