fix: invalid dataset data clear (#3927)

* fix: collection list count

* fix: collection list count

* fix: invalid dataset data clear

* update ts

* perf: cron clear invalid data

* perf: init

* perf: clear invalid code

* update init

* perf: clear invalid code

* perf: clear invalid code

* perf: init count

* batch init

* batch init

* batch init

* batch init

* add comment

* perf: init

* fix: api proxy type
This commit is contained in:
Archer
2025-02-28 17:49:20 +08:00
committed by GitHub
parent ac4255ea0c
commit cf0aaa1091
13 changed files with 286 additions and 96 deletions

View File

@@ -174,6 +174,14 @@ export const syncCollection = async (collection: CollectionWithDatasetType) => {
}
await mongoSessionRun(async (session) => {
// Delete old collection
await delCollection({
collections: [collection],
delImg: false,
delFile: false,
session
});
// Create new collection
await createCollectionAndInsertData({
session,
@@ -208,13 +216,6 @@ export const syncCollection = async (collection: CollectionWithDatasetType) => {
updateTime: new Date()
}
});
// Delete old collection
await delCollection({
collections: [collection],
delRelatedSource: false,
session
});
});
return DatasetCollectionSyncResultEnum.success;