Skip to content

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

Fix: remvoe async wrappers (#12405)

Magicbook1108f56bceb2a9f9
diff --git a/rag/svr/sync_data_source.py b/rag/svr/sync_data_source.py
index c1aa3e3e99..eb4445d8e0 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,