Feat: enable sync deleted files in gitlab (#14481)

### What problem does this PR solve?

Feat: enable sync deleted files in gitlab

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
Magicbook1108
2026-04-29 19:04:10 +08:00
committed by GitHub
parent a0f9ae16d2
commit db1a73b255
3 changed files with 75 additions and 3 deletions

View File

@@ -1305,6 +1305,7 @@ class Gitlab(SyncBase):
}
)
file_list = None
if task["reindex"] == "1" or not task["poll_range_start"]:
document_generator = self.connector.load_from_state()
_begin_info = "totally"
@@ -1318,9 +1319,13 @@ class Gitlab(SyncBase):
poll_start.timestamp(),
datetime.now(timezone.utc).timestamp()
)
if self.conf.get("sync_deleted_files"):
file_list = []
for slim_batch in self.connector.retrieve_all_slim_docs_perm_sync():
file_list.extend(slim_batch)
_begin_info = "from {}".format(poll_start)
self.log_connection("Gitlab", f"({self.conf['project_name']})", task)
return document_generator
return document_generator, file_list
class Bitbucket(SyncBase):