From f56bceb2a9f9aa7553d5d3e8c5b437e69d41c59b Mon Sep 17 00:00:00 2001 From: Magicbook1108 Date: Sun, 4 Jan 2026 11:19:48 +0800 Subject: [PATCH] Fix: remvoe async wrappers (#12405) ### What problem does this PR solve? Fix: remvoe async wrappers #12396 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- rag/svr/sync_data_source.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/rag/svr/sync_data_source.py b/rag/svr/sync_data_source.py index c1aa3e3e9..eb4445d8e 100644 --- a/rag/svr/sync_data_source.py +++ b/rag/svr/sync_data_source.py @@ -113,7 +113,7 @@ class SyncBase: if task["poll_range_start"]: next_update = task["poll_range_start"] - async for document_batch in document_batch_generator: + for document_batch in document_batch_generator: if not document_batch: continue @@ -323,12 +323,12 @@ class Confluence(SyncBase): if pending_docs: yield pending_docs - async def async_wrapper(): + def wrapper(): for batch in document_batches(): yield batch logging.info("Connect to Confluence: {} {}".format(self.conf["wiki_base"], begin_info)) - return async_wrapper() + return wrapper() class Notion(SyncBase): @@ -697,11 +697,11 @@ class WebDAV(SyncBase): begin_info )) - async def async_wrapper(): + def wrapper(): for document_batch in document_batch_generator: yield document_batch - - return async_wrapper() + + return wrapper() class Moodle(SyncBase): @@ -911,7 +911,7 @@ class Github(SyncBase): if next_checkpoint is not None: checkpoint = next_checkpoint - async def async_wrapper(): + def wrapper(): for batch in document_batches(): yield batch @@ -922,7 +922,7 @@ class Github(SyncBase): begin_info, ) - return async_wrapper() + return wrapper() class IMAP(SyncBase): SOURCE_NAME: str = FileSource.IMAP @@ -979,7 +979,7 @@ class IMAP(SyncBase): if pending_docs: yield pending_docs - async def async_wrapper(): + def wrapper(): for batch in document_batches(): yield batch @@ -991,7 +991,7 @@ class IMAP(SyncBase): self.conf["imap_mailbox"], begin_info ) - return async_wrapper() + return wrapper() class Zendesk(SyncBase): @@ -1061,7 +1061,7 @@ class Zendesk(SyncBase): if pending_docs: yield pending_docs - async def async_wrapper(): + def wrapper(): for batch in document_batches(): yield batch @@ -1071,7 +1071,7 @@ class Zendesk(SyncBase): begin_info, ) - return async_wrapper() + return wrapper() class Gitlab(SyncBase): @@ -1163,7 +1163,7 @@ class Bitbucket(SyncBase): checkpoint = e.value break - async def async_wrapper(): + def wrapper(): for batch in document_batches(): yield batch @@ -1173,7 +1173,7 @@ class Bitbucket(SyncBase): begin_info, ) - return async_wrapper() + return wrapper() func_factory = { FileSource.S3: S3,