refactor(cleaner): batch query and controlled parallel order processing

This commit is contained in:
test
2026-03-16 21:47:13 +08:00
parent 9248be6310
commit 6a2fba0e57
8 changed files with 484 additions and 236 deletions

View File

@@ -210,7 +210,11 @@ export function registerCleanerHandlers(): void {
}
}
log.info('Starting cleaning', { orderCount: validOrderNumbers.length })
log.info('Starting cleaning', {
orderCount: validOrderNumbers.length,
queryBatchSize: input.queryBatchSize ?? 100,
processConcurrency: input.processConcurrency ?? 1
})
const result = await cleaner.clean(modifiedInput)
if (warnings.length > 0) {
@@ -249,6 +253,8 @@ export function registerCleanerHandlers(): void {
metadata: {
orderCount: validOrderNumbers.length,
dryRun: input.dryRun ?? false,
queryBatchSize: input.queryBatchSize ?? 100,
processConcurrency: input.processConcurrency ?? 1,
materialsDeleted: result.materialsDeleted,
materialsSkipped: result.materialsSkipped,
errorCount: result.errors.length