시스템 모니터
This commit is contained in:
20
backend/plugins/privnet-init.ts
Normal file
20
backend/plugins/privnet-init.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { initPrivnetTables } from '../utils/db'
|
||||
import { privnetScheduler } from '../utils/privnet-scheduler'
|
||||
|
||||
export default defineNitroPlugin((nitroApp) => {
|
||||
console.log('[Plugin] privnet-init starting...')
|
||||
|
||||
// DB 테이블 초기화
|
||||
initPrivnetTables()
|
||||
|
||||
// 스케줄러 자동 시작
|
||||
privnetScheduler.start()
|
||||
|
||||
// 서버 종료 시 클린업
|
||||
nitroApp.hooks.hook('close', () => {
|
||||
console.log('[Plugin] Shutting down privnet scheduler...')
|
||||
privnetScheduler.stop()
|
||||
})
|
||||
|
||||
console.log('[Plugin] privnet-init completed')
|
||||
})
|
||||
Reference in New Issue
Block a user