게시물 가져오기 작업 센터 추가

This commit is contained in:
2026-07-23 18:35:29 +09:00
parent 85b6fe7033
commit ef7c1216e4
16 changed files with 1178 additions and 95 deletions

View File

@@ -0,0 +1,22 @@
import { Cron } from 'croner'
import { queuePendingPostImportJobs } from '../repositories/post-import-repository'
const queuePostImportWork = async () => {
try {
await queuePendingPostImportJobs()
} catch (error) {
console.error('[post-import] 작업 복구 확인 실패', error)
}
}
export default defineNitroPlugin(() => {
if (process.env.NUXT_POST_IMPORT_WORKER === '0' || process.env.PLAYWRIGHT_TEST === '1') {
return
}
queuePostImportWork()
new Cron('*/15 * * * * *', {
protect: true
}, queuePostImportWork)
})