简单的定时任务--ok
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user