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)
This commit is contained in:
Magicbook1108
2026-01-04 11:19:48 +08:00
committed by GitHub
parent bbaf918d74
commit f56bceb2a9

View File

@ -113,7 +113,7 @@ class SyncBase:
if task["poll_range_start"]: if task["poll_range_start"]:
next_update = 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: if not document_batch:
continue continue
@ -323,12 +323,12 @@ class Confluence(SyncBase):
if pending_docs: if pending_docs:
yield pending_docs yield pending_docs
async def async_wrapper(): def wrapper():
for batch in document_batches(): for batch in document_batches():
yield batch yield batch
logging.info("Connect to Confluence: {} {}".format(self.conf["wiki_base"], begin_info)) logging.info("Connect to Confluence: {} {}".format(self.conf["wiki_base"], begin_info))
return async_wrapper() return wrapper()
class Notion(SyncBase): class Notion(SyncBase):
@ -697,11 +697,11 @@ class WebDAV(SyncBase):
begin_info begin_info
)) ))
async def async_wrapper(): def wrapper():
for document_batch in document_batch_generator: for document_batch in document_batch_generator:
yield document_batch yield document_batch
return async_wrapper() return wrapper()
class Moodle(SyncBase): class Moodle(SyncBase):
@ -911,7 +911,7 @@ class Github(SyncBase):
if next_checkpoint is not None: if next_checkpoint is not None:
checkpoint = next_checkpoint checkpoint = next_checkpoint
async def async_wrapper(): def wrapper():
for batch in document_batches(): for batch in document_batches():
yield batch yield batch
@ -922,7 +922,7 @@ class Github(SyncBase):
begin_info, begin_info,
) )
return async_wrapper() return wrapper()
class IMAP(SyncBase): class IMAP(SyncBase):
SOURCE_NAME: str = FileSource.IMAP SOURCE_NAME: str = FileSource.IMAP
@ -979,7 +979,7 @@ class IMAP(SyncBase):
if pending_docs: if pending_docs:
yield pending_docs yield pending_docs
async def async_wrapper(): def wrapper():
for batch in document_batches(): for batch in document_batches():
yield batch yield batch
@ -991,7 +991,7 @@ class IMAP(SyncBase):
self.conf["imap_mailbox"], self.conf["imap_mailbox"],
begin_info begin_info
) )
return async_wrapper() return wrapper()
class Zendesk(SyncBase): class Zendesk(SyncBase):
@ -1061,7 +1061,7 @@ class Zendesk(SyncBase):
if pending_docs: if pending_docs:
yield pending_docs yield pending_docs
async def async_wrapper(): def wrapper():
for batch in document_batches(): for batch in document_batches():
yield batch yield batch
@ -1071,7 +1071,7 @@ class Zendesk(SyncBase):
begin_info, begin_info,
) )
return async_wrapper() return wrapper()
class Gitlab(SyncBase): class Gitlab(SyncBase):
@ -1163,7 +1163,7 @@ class Bitbucket(SyncBase):
checkpoint = e.value checkpoint = e.value
break break
async def async_wrapper(): def wrapper():
for batch in document_batches(): for batch in document_batches():
yield batch yield batch
@ -1173,7 +1173,7 @@ class Bitbucket(SyncBase):
begin_info, begin_info,
) )
return async_wrapper() return wrapper()
func_factory = { func_factory = {
FileSource.S3: S3, FileSource.S3: S3,