Docker 파일

This commit is contained in:
2025-12-28 14:10:35 +09:00
parent 9d2a6638b5
commit ba7a208da9
3 changed files with 4 additions and 118 deletions

View File

@@ -1,18 +1,15 @@
import { initPubnetTables, shouldAutoStartScheduler } from '../utils/db'
import { shouldAutoStartScheduler } from '../utils/db'
import { pubnetScheduler } from '../utils/pubnet-scheduler'
export default defineNitroPlugin(async (nitroApp) => {
console.log('[Plugin] pubnet-init starting...')
// DB 테이블 초기화
await initPubnetTables()
// 스케줄러 자동 시작 (환경에 따라)
if (shouldAutoStartScheduler()) {
pubnetScheduler.start()
console.log('[Plugin] pubnet scheduler auto-started (production mode)')
} else {
console.log('[Plugin] pubnet scheduler NOT started (development mode - use API to start)')
console.log('[Plugin] pubnet scheduler NOT started (development mode)')
}
// 서버 종료 시 클린업