简单的定时任务--ok

This commit is contained in:
yml2213
2026-05-14 17:59:45 +08:00
parent b6c493d5e7
commit f7f3289d04
19 changed files with 954 additions and 5 deletions
+4
View File
@@ -9,6 +9,7 @@ import open91Router from './routes/open-91.js'
import webhooksRouter from './routes/webhooks.js'
import { ensureAdminUsersBootstrapped } from './services/admin/admin-auth-service.js'
import { ensureFulfillmentCatalogBootstrapped } from './services/bootstrap/fulfillment-bootstrap-service.js'
import { startScheduledJobs, stopScheduledJobs } from './services/scheduler/scheduler-service.js'
import { closeLocalOcrWorker, warmupLocalOcrWorker } from './services/session/ocr.js'
import { closeAllTencentBrowserSessions, warmupTencentBrowser } from './services/session/session.js'
import { buildSuccessPayload } from './utils/http.js'
@@ -162,6 +163,7 @@ async function bootstrapCoreServices() {
attempt: startupState.core.attemptCount,
})
startScheduledJobs()
void bootstrapBrowser()
void bootstrapOcr()
break
@@ -358,6 +360,8 @@ async function shutdown(signal) {
startupState.phase = 'shutting_down'
logInfo('[shutdown]', `received ${signal}, closing browser sessions and HTTP server`)
stopScheduledJobs()
try {
await closeAllTencentBrowserSessions({ markClosed: true })
} catch (error) {