feat(cleaner): add outer-level retry on fatal crash with execution ID

When CleanerService hits a fatal error (browser crash, timeout), the
outer catch now sets result.crashed=true. CleanerApplicationService
detects this, closes the dead browser session, re-logs into ERP, and
re-runs all orders once. An execution ID (CLN-yyyyMMddHHmmss-XXXX)
generated at startup ensures report files are deduplicated across
retries. Reports now display execution ID and app version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-04-13 10:07:29 +08:00
parent 8b173890fa
commit e1d55b8b39
7 changed files with 246 additions and 12 deletions

View File

@@ -384,6 +384,7 @@ export class CleanerService {
...(popupPage ? await capturePageContext(popupPage, undefined, 'cleaner.outerCatch') : {})
})
result.errors.push(`Clean failed: ${message}`)
result.crashed = true
} finally {
if (popupPage) {
try {