@open-mercato/scheduler 0.6.7-develop.6834.1.e76f4b8cbc → 0.6.7-develop.6851.1.c1680b00d8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/modules/scheduler/api/jobs/[id]/executions/route.js +4 -2
- package/dist/modules/scheduler/api/jobs/[id]/executions/route.js.map +2 -2
- package/dist/modules/scheduler/api/queue-jobs/[jobId]/route.js +4 -2
- package/dist/modules/scheduler/api/queue-jobs/[jobId]/route.js.map +2 -2
- package/dist/modules/scheduler/i18n/ko.json +157 -0
- package/dist/modules/scheduler/services/bullmqSchedulerService.js +90 -41
- package/dist/modules/scheduler/services/bullmqSchedulerService.js.map +2 -2
- package/package.json +6 -6
- package/src/modules/scheduler/api/jobs/[id]/executions/route.ts +4 -2
- package/src/modules/scheduler/api/queue-jobs/[jobId]/route.ts +4 -2
- package/src/modules/scheduler/i18n/ko.json +157 -0
- package/src/modules/scheduler/services/__tests__/bullmqSchedulerService.test.ts +224 -163
- package/src/modules/scheduler/services/bullmqSchedulerService.ts +133 -47
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/modules/scheduler/services/bullmqSchedulerService.ts"],
|
|
4
|
-
"sourcesContent": ["import type { EntityManager } from '@mikro-orm/core'\nimport { ScheduledJob } from '../data/entities.js'\nimport { recalculateNextRun } from '../lib/nextRunCalculator'\nimport { parseCronExpression } from '../lib/cronParser'\nimport { resolveScheduleIntervalMs } from '../lib/intervalParser'\nimport { getRedisUrlOrThrow } from '@open-mercato/shared/lib/redis/connection'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\n\nconst logger = createLogger('scheduler').child({ component: 'bullmq' })\n\ninterface BullRepeatableJob {\n key: string\n name: string\n id?: string | null\n}\n\ninterface BullRepeatOptions {\n tz?: string\n pattern?: string\n every?: number\n}\n\ninterface BullQueue {\n add(name: string, data: unknown, opts?: unknown): Promise<unknown>\n getRepeatableJobs?(): Promise<BullRepeatableJob[]>\n removeRepeatableByKey?(key: string): Promise<boolean>\n close(): Promise<void>\n}\n\n/**\n * Production scheduler using BullMQ repeatable jobs.\n * \n * Requires Redis. Set QUEUE_STRATEGY=async to use this service.\n * \n * This service syncs database schedules with BullMQ's repeat mechanism.\n * When a schedule is created/updated/deleted in the database, this service\n * adds/updates/removes the corresponding BullMQ repeatable job.\n * \n * BullMQ handles:\n * - Exact timing based on cron expressions or intervals\n * - Distributed locking across multiple instances\n * - Automatic retries if worker fails\n * \n * The worker loads fresh schedule config from DB on each execution,\n * so updates to schedules take effect immediately.\n */\nexport class BullMQSchedulerService {\n private queue: BullQueue | null = null\n \n constructor(\n private em: () => EntityManager,\n ) {}\n\n /**\n * Lazy-load and return the BullMQ queue instance\n */\n private async getQueue(): Promise<BullQueue> {\n if (!this.queue) {\n try {\n const { Queue } = await import('bullmq')\n this.queue = new Queue('scheduler-execution', { connection: { url: getRedisUrlOrThrow('QUEUE') } })\n } catch {\n throw new Error('BullMQ is required for async scheduler. Install it with: npm install bullmq')\n }\n }\n return this.queue\n }\n\n private getScheduleJobName(scheduleId: string): string {\n return `schedule-${scheduleId}`\n }\n\n private getScheduleIdFromRepeatableJob(job: BullRepeatableJob): string | null {\n const candidate = job.id?.startsWith('schedule-')\n ? job.id\n : job.name?.startsWith('schedule-')\n ? job.name\n : null\n\n return candidate ? candidate.slice('schedule-'.length) : null\n }\n\n private isRepeatableJobForSchedule(job: BullRepeatableJob, scheduleId: string): boolean {\n const jobName = this.getScheduleJobName(scheduleId)\n return job.id === jobName || job.name === jobName\n }\n\n private async removeRepeatableJobsForSchedule(queue: BullQueue, scheduleId: string): Promise<number> {\n const repeatableJobs = await queue.getRepeatableJobs?.()\n if (!repeatableJobs || typeof queue.removeRepeatableByKey !== 'function') {\n return 0\n }\n\n let removed = 0\n for (const job of repeatableJobs) {\n if (!this.isRepeatableJobForSchedule(job, scheduleId)) continue\n await queue.removeRepeatableByKey(job.key)\n removed += 1\n }\n\n return removed\n }\n\n /**\n * Register a schedule with BullMQ repeatable jobs\n * @param schedule - The schedule to register\n * @param options - Optional configuration\n * @param options.skipNextRunUpdate - If true, skip updating nextRunAt (used when called from hooks)\n */\n async register(schedule: ScheduledJob, options: { skipNextRunUpdate?: boolean } = {}): Promise<void> {\n if (!schedule.isEnabled) {\n logger.debug('Skipping disabled schedule', { scheduleId: schedule.id })\n return\n }\n\n try {\n // Calculate and update next run time (unless skipped)\n if (!options.skipNextRunUpdate) {\n const nextRun = recalculateNextRun(\n schedule.scheduleType,\n schedule.scheduleValue,\n schedule.timezone\n )\n \n if (nextRun) {\n schedule.nextRunAt = nextRun\n // Flush will be handled by the caller\n }\n }\n\n // Build BullMQ repeat options based on schedule type\n const repeatOpts = this.buildRepeatOptions(schedule)\n\n // Add repeatable job to BullMQ\n // IMPORTANT: Wrap in QueuedJob format to match queue strategy expectations\n // BullMQ will store this in job.data, and the async strategy worker expects\n // job.data to be a QueuedJob with id, payload, and createdAt\n const queue = await this.getQueue()\n const jobName = this.getScheduleJobName(schedule.id)\n await this.removeRepeatableJobsForSchedule(queue, schedule.id)\n \n // For repeatable jobs, we need to provide a stable ID in the data\n // that will be used for each repeat instance\n // CRITICAL: Include scope information (tenantId, organizationId, scopeType)\n // for proper multi-tenant isolation and auditing\n const jobData = {\n id: jobName,\n payload: { \n scheduleId: schedule.id,\n tenantId: schedule.tenantId,\n organizationId: schedule.organizationId,\n scopeType: schedule.scopeType,\n },\n createdAt: new Date().toISOString(),\n }\n \n logger.debug('Adding repeatable job', {\n jobName,\n scheduleId: schedule.id,\n scopeType: schedule.scopeType,\n tenantId: schedule.tenantId,\n organizationId: schedule.organizationId,\n repeatOpts,\n })\n \n await queue.add(\n jobName, // Job name - used as part of repeatable job key\n jobData, // Job data in QueuedJob format\n {\n repeat: repeatOpts,\n // Don't set jobId for repeatable jobs - BullMQ generates unique IDs for each instance\n removeOnComplete: {\n age: 86400 * 30, // Keep completed jobs for 30 days (execution history)\n count: 1000, // Keep last 1000 completed jobs\n },\n removeOnFail: {\n age: 86400 * 90, // Keep failed jobs for 90 days (debugging/audit)\n count: 5000, // Keep last 5000 failed jobs\n },\n }\n )\n\n logger.debug('Registered schedule', {\n scheduleId: schedule.id,\n scheduleName: schedule.name,\n type: schedule.scheduleType,\n pattern: schedule.scheduleValue,\n timezone: schedule.timezone,\n })\n } catch (error: unknown) {\n logger.error('Failed to register schedule', { scheduleId: schedule.id, err: error })\n throw error\n }\n }\n\n /**\n * Unregister a schedule from BullMQ repeatable jobs\n */\n async unregister(scheduleId: string): Promise<void> {\n try {\n const queue = await this.getQueue()\n\n const removed = await this.removeRepeatableJobsForSchedule(queue, scheduleId)\n if (removed > 0) {\n logger.debug('Unregistered schedule', { scheduleId })\n } else {\n logger.debug('No repeatable job found for schedule', { scheduleId })\n }\n } catch (error: unknown) {\n logger.error('Failed to unregister schedule', { scheduleId, err: error })\n throw error\n }\n }\n\n /**\n * Sync all enabled schedules with BullMQ\n * Useful for initialization or repair\n */\n async syncAll(): Promise<void> {\n const em = this.em().fork()\n const queue = await this.getQueue()\n \n logger.debug('Starting full sync')\n\n // Get all BullMQ repeatable jobs\n const repeatableJobs = await queue.getRepeatableJobs?.() || []\n const bullmqScheduleIds = new Set<string>()\n const bullmqScheduleCounts = new Map<string, number>()\n for (const job of repeatableJobs) {\n const scheduleId = this.getScheduleIdFromRepeatableJob(job)\n if (!scheduleId) continue\n bullmqScheduleIds.add(scheduleId)\n bullmqScheduleCounts.set(scheduleId, (bullmqScheduleCounts.get(scheduleId) ?? 0) + 1)\n }\n\n // Get enabled schedules from database in batches to avoid unbounded loads\n const BATCH_SIZE = 500\n const dbSchedules: ScheduledJob[] = []\n let offset = 0\n let batch: ScheduledJob[]\n do {\n batch = await em.find(ScheduledJob, {\n isEnabled: true,\n deletedAt: null,\n }, { limit: BATCH_SIZE, offset })\n dbSchedules.push(...batch)\n offset += BATCH_SIZE\n } while (batch.length === BATCH_SIZE)\n\n const dbScheduleIds = new Set(dbSchedules.map(s => s.id))\n\n // Register schedules that exist in DB but not in BullMQ\n for (const schedule of dbSchedules) {\n if (!bullmqScheduleIds.has(schedule.id)) {\n logger.debug('Registering missing schedule', { scheduleId: schedule.id, scheduleName: schedule.name })\n await this.register(schedule)\n } else if ((bullmqScheduleCounts.get(schedule.id) ?? 0) > 1) {\n logger.info('Repairing duplicate repeatable jobs', { scheduleId: schedule.id })\n await this.register(schedule)\n }\n }\n\n // Remove BullMQ jobs that don't exist in DB or are disabled\n for (const scheduleId of bullmqScheduleIds) {\n if (!dbScheduleIds.has(scheduleId)) {\n logger.info('Removing orphaned schedule', { scheduleId })\n await this.unregister(String(scheduleId))\n }\n }\n\n logger.debug('Sync complete', { activeSchedules: dbSchedules.length })\n }\n\n /**\n * Build BullMQ repeat options from schedule configuration\n */\n private buildRepeatOptions(schedule: ScheduledJob): BullRepeatOptions {\n const opts: BullRepeatOptions = {\n tz: schedule.timezone || 'UTC',\n }\n\n if (schedule.scheduleType === 'cron') {\n // Validate cron expression\n const parsedCron = parseCronExpression(schedule.scheduleValue, schedule.timezone || 'UTC')\n if (!parsedCron.isValid) {\n throw new Error(parsedCron.error || 'Invalid cron expression')\n }\n opts.pattern = schedule.scheduleValue\n } else if (schedule.scheduleType === 'interval') {\n // Parse interval (e.g., \"15m\", \"2h\", \"1d\")\n const intervalMs = resolveScheduleIntervalMs(schedule.scheduleValue)\n opts.every = intervalMs\n } else {\n throw new Error(`Unsupported schedule type: ${schedule.scheduleType}`)\n }\n\n return opts\n }\n\n /**\n * Get list of all repeatable jobs from BullMQ\n */\n async getRepeatableJobs(): Promise<unknown[]> {\n try {\n const queue = await this.getQueue()\n return await queue.getRepeatableJobs?.() || []\n } catch (error) {\n logger.error('Failed to get repeatable jobs', { err: error })\n return []\n }\n }\n\n /**\n * Close the cached BullMQ queue connection.\n * Must be called during graceful shutdown to prevent Redis connection leaks.\n */\n async destroy(): Promise<void> {\n if (this.queue) {\n try {\n await this.queue.close()\n this.queue = null\n logger.debug('Queue connection closed')\n } catch (error) {\n logger.error('Error closing queue', { err: error })\n }\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "AACA,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AACnC,SAAS,2BAA2B;AACpC,SAAS,iCAAiC;AAC1C,SAAS,
|
|
4
|
+
"sourcesContent": ["import type { EntityManager } from '@mikro-orm/core'\nimport { ScheduledJob } from '../data/entities.js'\nimport { recalculateNextRun } from '../lib/nextRunCalculator'\nimport { parseCronExpression } from '../lib/cronParser'\nimport { resolveScheduleIntervalMs } from '../lib/intervalParser'\nimport { getRedisUrlOrThrow, parseRedisUrl } from '@open-mercato/shared/lib/redis/connection'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\n\nconst logger = createLogger('scheduler').child({ component: 'bullmq' })\n\ninterface BullJobScheduler {\n key: string\n name: string\n id?: string | null\n}\n\ninterface BullRepeatableJob {\n key: string\n name: string\n id?: string | null\n}\n\ninterface BullRepeatOptions {\n tz?: string\n pattern?: string\n every?: number\n}\n\ninterface BullQueue {\n add(name: string, data: unknown, opts?: Record<string, unknown>): Promise<unknown>\n getRepeatableJobs?(): Promise<BullRepeatableJob[]>\n removeRepeatableByKey?(key: string): Promise<boolean>\n upsertJobScheduler?(\n id: string,\n repeatOptions: BullRepeatOptions,\n jobTemplate: { name: string; data: unknown; opts: Record<string, unknown> },\n ): Promise<unknown>\n getJobSchedulers?(): Promise<BullJobScheduler[]>\n removeJobScheduler?(id: string): Promise<boolean>\n close(): Promise<void>\n}\n\ntype BullJobSchedulerQueue = BullQueue & Required<Pick<\n BullQueue,\n 'upsertJobScheduler' | 'getJobSchedulers' | 'removeJobScheduler'\n>>\n\n/**\n * Production scheduler using BullMQ Job Schedulers.\n * \n * Requires Redis. Set QUEUE_STRATEGY=async to use this service.\n * \n * This service syncs database schedules with BullMQ's Job Scheduler mechanism.\n * When a schedule is created/updated/deleted in the database, this service\n * adds/updates/removes the corresponding BullMQ Job Scheduler.\n * \n * BullMQ handles:\n * - Exact timing based on cron expressions or intervals\n * - Distributed locking across multiple instances\n * - Automatic retries if worker fails\n * \n * The worker loads fresh schedule config from DB on each execution,\n * so updates to schedules take effect immediately.\n */\nexport class BullMQSchedulerService {\n private queue: BullQueue | null = null\n \n constructor(\n private em: () => EntityManager,\n ) {}\n\n /**\n * Lazy-load and return the BullMQ queue instance\n */\n private async getQueue(): Promise<BullQueue> {\n if (!this.queue) {\n try {\n const { Queue } = await import('bullmq')\n this.queue = new Queue('scheduler-execution', {\n connection: parseRedisUrl(getRedisUrlOrThrow('QUEUE')),\n })\n } catch {\n throw new Error('BullMQ is required for async scheduler. Install it with: npm install bullmq')\n }\n }\n return this.queue\n }\n\n private getScheduleJobName(scheduleId: string): string {\n return `schedule-${scheduleId}`\n }\n\n private getScheduleIdFromJobScheduler(job: BullJobScheduler): string | null {\n const candidate = [job.key, job.id, job.name]\n .find((value) => value?.startsWith('schedule-'))\n\n return candidate ? candidate.slice('schedule-'.length) : null\n }\n\n private isJobSchedulerForSchedule(job: BullJobScheduler, scheduleId: string): boolean {\n return this.getScheduleIdFromJobScheduler(job) === scheduleId\n }\n\n private isCanonicalJobScheduler(job: BullJobScheduler, scheduleId: string): boolean {\n return job.key === this.getScheduleJobName(scheduleId)\n }\n\n private supportsJobSchedulers(queue: BullQueue): queue is BullJobSchedulerQueue {\n return typeof queue.upsertJobScheduler === 'function'\n && typeof queue.getJobSchedulers === 'function'\n && typeof queue.removeJobScheduler === 'function'\n }\n\n private isRepeatableJobForSchedule(job: BullRepeatableJob, scheduleId: string): boolean {\n const jobName = this.getScheduleJobName(scheduleId)\n return job.id === jobName || job.name === jobName\n }\n\n private async removeLegacyRepeatableJobs(queue: BullQueue, scheduleId: string): Promise<number> {\n const repeatableJobs = await queue.getRepeatableJobs?.()\n if (!repeatableJobs || typeof queue.removeRepeatableByKey !== 'function') {\n return 0\n }\n\n let removed = 0\n for (const job of repeatableJobs) {\n if (!this.isRepeatableJobForSchedule(job, scheduleId)) continue\n await queue.removeRepeatableByKey(job.key)\n removed += 1\n }\n return removed\n }\n\n /**\n * Register a schedule with BullMQ Job Schedulers\n * @param schedule - The schedule to register\n * @param options - Optional configuration\n * @param options.skipNextRunUpdate - If true, skip updating nextRunAt (used when called from hooks)\n */\n async register(schedule: ScheduledJob, options: { skipNextRunUpdate?: boolean } = {}): Promise<void> {\n if (!schedule.isEnabled) {\n logger.debug('Skipping disabled schedule', { scheduleId: schedule.id })\n return\n }\n\n try {\n // Calculate and update next run time (unless skipped)\n if (!options.skipNextRunUpdate) {\n const nextRun = recalculateNextRun(\n schedule.scheduleType,\n schedule.scheduleValue,\n schedule.timezone\n )\n \n if (nextRun) {\n schedule.nextRunAt = nextRun\n // Flush will be handled by the caller\n }\n }\n\n // Build BullMQ repeat options based on schedule type\n const repeatOpts = this.buildRepeatOptions(schedule)\n\n // Upsert the BullMQ Job Scheduler\n // IMPORTANT: Wrap in QueuedJob format to match queue strategy expectations\n // BullMQ will store this in job.data, and the async strategy worker expects\n // job.data to be a QueuedJob with id, payload, and createdAt\n const queue = await this.getQueue()\n const jobName = this.getScheduleJobName(schedule.id)\n \n // Job Scheduler instances use a stable ID in the data\n // that will be used for each repeat instance\n // CRITICAL: Include scope information (tenantId, organizationId, scopeType)\n // for proper multi-tenant isolation and auditing\n const jobData = {\n id: jobName,\n payload: { \n scheduleId: schedule.id,\n tenantId: schedule.tenantId,\n organizationId: schedule.organizationId,\n scopeType: schedule.scopeType,\n },\n createdAt: new Date().toISOString(),\n }\n \n logger.debug('Upserting job scheduler', {\n jobName,\n scheduleId: schedule.id,\n scopeType: schedule.scopeType,\n tenantId: schedule.tenantId,\n organizationId: schedule.organizationId,\n repeatOpts,\n })\n \n const jobOptions = {\n removeOnComplete: {\n age: 86400 * 30,\n count: 1000,\n },\n removeOnFail: {\n age: 86400 * 90,\n count: 5000,\n },\n }\n\n if (this.supportsJobSchedulers(queue)) {\n const existingJobSchedulers = await queue.getJobSchedulers()\n await queue.upsertJobScheduler(\n jobName,\n repeatOpts,\n {\n name: jobName,\n data: jobData,\n opts: jobOptions,\n },\n )\n for (const jobScheduler of existingJobSchedulers) {\n if (\n this.isJobSchedulerForSchedule(jobScheduler, schedule.id)\n && !this.isCanonicalJobScheduler(jobScheduler, schedule.id)\n ) {\n await queue.removeJobScheduler(jobScheduler.key)\n }\n }\n } else {\n await this.removeLegacyRepeatableJobs(queue, schedule.id)\n await queue.add(jobName, jobData, { repeat: repeatOpts, ...jobOptions })\n }\n\n logger.debug('Registered schedule', {\n scheduleId: schedule.id,\n scheduleName: schedule.name,\n type: schedule.scheduleType,\n pattern: schedule.scheduleValue,\n timezone: schedule.timezone,\n })\n } catch (error: unknown) {\n logger.error('Failed to register schedule', { scheduleId: schedule.id, err: error })\n throw error\n }\n }\n\n /**\n * Unregister a schedule from BullMQ Job Schedulers\n */\n async unregister(scheduleId: string): Promise<void> {\n try {\n const queue = await this.getQueue()\n if (this.supportsJobSchedulers(queue)) {\n const jobSchedulers = await queue.getJobSchedulers()\n const matchingJobSchedulers = jobSchedulers.filter((job) => (\n this.isJobSchedulerForSchedule(job, scheduleId)\n ))\n if (matchingJobSchedulers.length > 0) {\n for (const jobScheduler of matchingJobSchedulers) {\n await queue.removeJobScheduler(jobScheduler.key)\n }\n logger.debug('Unregistered schedule', { scheduleId })\n } else {\n logger.debug('No job scheduler found for schedule', { scheduleId })\n }\n return\n }\n\n const removed = await this.removeLegacyRepeatableJobs(queue, scheduleId)\n if (removed > 0) {\n logger.debug('Unregistered schedule', { scheduleId })\n } else {\n logger.debug('No repeatable job found for schedule', { scheduleId })\n }\n } catch (error: unknown) {\n logger.error('Failed to unregister schedule', { scheduleId, err: error })\n throw error\n }\n }\n\n /**\n * Sync all enabled schedules with BullMQ\n * Useful for initialization or repair\n */\n async syncAll(): Promise<void> {\n const em = this.em().fork()\n const queue = await this.getQueue()\n \n logger.debug('Starting full sync')\n\n const bullmqScheduleIds = new Set<string>()\n const bullmqScheduleCounts = new Map<string, number>()\n const canonicalJobSchedulerIds = new Set<string>()\n if (this.supportsJobSchedulers(queue)) {\n const jobSchedulers = await queue.getJobSchedulers()\n for (const job of jobSchedulers) {\n const scheduleId = this.getScheduleIdFromJobScheduler(job)\n if (!scheduleId) continue\n bullmqScheduleIds.add(scheduleId)\n bullmqScheduleCounts.set(scheduleId, (bullmqScheduleCounts.get(scheduleId) ?? 0) + 1)\n if (this.isCanonicalJobScheduler(job, scheduleId)) {\n canonicalJobSchedulerIds.add(scheduleId)\n }\n }\n } else {\n const repeatableJobs = await queue.getRepeatableJobs?.() ?? []\n for (const job of repeatableJobs) {\n const candidate = job.id?.startsWith('schedule-')\n ? job.id\n : job.name?.startsWith('schedule-')\n ? job.name\n : null\n if (!candidate) continue\n const scheduleId = candidate.slice('schedule-'.length)\n bullmqScheduleIds.add(scheduleId)\n bullmqScheduleCounts.set(scheduleId, (bullmqScheduleCounts.get(scheduleId) ?? 0) + 1)\n }\n }\n\n // Get enabled schedules from database in batches to avoid unbounded loads\n const BATCH_SIZE = 500\n const dbSchedules: ScheduledJob[] = []\n let offset = 0\n let batch: ScheduledJob[]\n do {\n batch = await em.find(ScheduledJob, {\n isEnabled: true,\n deletedAt: null,\n }, { limit: BATCH_SIZE, offset })\n dbSchedules.push(...batch)\n offset += BATCH_SIZE\n } while (batch.length === BATCH_SIZE)\n\n const dbScheduleIds = new Set(dbSchedules.map(s => s.id))\n\n // Register schedules that exist in DB but not in BullMQ\n for (const schedule of dbSchedules) {\n if (!bullmqScheduleIds.has(schedule.id)) {\n logger.debug('Registering missing schedule', { scheduleId: schedule.id, scheduleName: schedule.name })\n await this.register(schedule)\n } else if (\n (bullmqScheduleCounts.get(schedule.id) ?? 0) > 1\n || !canonicalJobSchedulerIds.has(schedule.id)\n ) {\n logger.info('Migrating legacy or duplicate job scheduler', { scheduleId: schedule.id })\n await this.register(schedule)\n }\n }\n\n // Remove BullMQ jobs that don't exist in DB or are disabled\n for (const scheduleId of bullmqScheduleIds) {\n if (!dbScheduleIds.has(scheduleId)) {\n logger.info('Removing orphaned schedule', { scheduleId })\n await this.unregister(String(scheduleId))\n }\n }\n\n logger.debug('Sync complete', { activeSchedules: dbSchedules.length })\n }\n\n /**\n * Build BullMQ repeat options from schedule configuration\n */\n private buildRepeatOptions(schedule: ScheduledJob): BullRepeatOptions {\n const opts: BullRepeatOptions = {\n tz: schedule.timezone || 'UTC',\n }\n\n if (schedule.scheduleType === 'cron') {\n // Validate cron expression\n const parsedCron = parseCronExpression(schedule.scheduleValue, schedule.timezone || 'UTC')\n if (!parsedCron.isValid) {\n throw new Error(parsedCron.error || 'Invalid cron expression')\n }\n opts.pattern = schedule.scheduleValue\n } else if (schedule.scheduleType === 'interval') {\n // Parse interval (e.g., \"15m\", \"2h\", \"1d\")\n const intervalMs = resolveScheduleIntervalMs(schedule.scheduleValue)\n opts.every = intervalMs\n } else {\n throw new Error(`Unsupported schedule type: ${schedule.scheduleType}`)\n }\n\n return opts\n }\n\n /**\n * Get list of all scheduled jobs from BullMQ\n */\n async getRepeatableJobs(): Promise<unknown[]> {\n try {\n const queue = await this.getQueue()\n if (this.supportsJobSchedulers(queue)) {\n return await queue.getJobSchedulers()\n }\n return await queue.getRepeatableJobs?.() ?? []\n } catch (error) {\n logger.error('Failed to get job schedulers', { err: error })\n return []\n }\n }\n\n /**\n * Close the cached BullMQ queue connection.\n * Must be called during graceful shutdown to prevent Redis connection leaks.\n */\n async destroy(): Promise<void> {\n if (this.queue) {\n try {\n await this.queue.close()\n this.queue = null\n logger.debug('Queue connection closed')\n } catch (error) {\n logger.error('Error closing queue', { err: error })\n }\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AACnC,SAAS,2BAA2B;AACpC,SAAS,iCAAiC;AAC1C,SAAS,oBAAoB,qBAAqB;AAClD,SAAS,oBAAoB;AAE7B,MAAM,SAAS,aAAa,WAAW,EAAE,MAAM,EAAE,WAAW,SAAS,CAAC;AAwD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
"version": "0.6.7-develop.
|
|
3
|
+
"version": "0.6.7-develop.6851.1.c1680b00d8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Database-managed scheduled jobs with admin UI",
|
|
6
6
|
"type": "module",
|
|
@@ -59,14 +59,14 @@
|
|
|
59
59
|
"./*/*/*/*/*/*.json": "./src/*/*/*/*/*/*.json"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@open-mercato/events": "0.6.7-develop.
|
|
63
|
-
"@open-mercato/queue": "0.6.7-develop.
|
|
62
|
+
"@open-mercato/events": "0.6.7-develop.6851.1.c1680b00d8",
|
|
63
|
+
"@open-mercato/queue": "0.6.7-develop.6851.1.c1680b00d8",
|
|
64
64
|
"cron-parser": "^5.6.2"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"@mikro-orm/core": "^7.0.14",
|
|
68
|
-
"@open-mercato/shared": "0.6.7-develop.
|
|
69
|
-
"bullmq": "^5.0.0",
|
|
68
|
+
"@open-mercato/shared": "0.6.7-develop.6851.1.c1680b00d8",
|
|
69
|
+
"bullmq": "^5.0.0 || ^6.0.0",
|
|
70
70
|
"ioredis": "^5.0.0",
|
|
71
71
|
"zod": ">=3.23.0"
|
|
72
72
|
},
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@open-mercato/shared": "0.6.7-develop.
|
|
82
|
+
"@open-mercato/shared": "0.6.7-develop.6851.1.c1680b00d8",
|
|
83
83
|
"@types/jest": "^30.0.0",
|
|
84
84
|
"@types/node": "^26.1.2",
|
|
85
85
|
"jest": "^30.4.2",
|
|
@@ -5,7 +5,7 @@ import { createRequestContainer } from '@open-mercato/shared/lib/di/container'
|
|
|
5
5
|
import type { EntityManager } from '@mikro-orm/core'
|
|
6
6
|
import type { OpenApiRouteDoc } from '@open-mercato/shared/lib/openapi'
|
|
7
7
|
import { ScheduledJob } from '../../../../data/entities.js'
|
|
8
|
-
import { getRedisUrlOrThrow } from '@open-mercato/shared/lib/redis/connection'
|
|
8
|
+
import { getRedisUrlOrThrow, parseRedisUrl } from '@open-mercato/shared/lib/redis/connection'
|
|
9
9
|
import { resolveTranslations } from '@open-mercato/shared/lib/i18n/server'
|
|
10
10
|
import { createLogger } from '@open-mercato/shared/lib/logger'
|
|
11
11
|
|
|
@@ -79,7 +79,9 @@ export async function GET(
|
|
|
79
79
|
|
|
80
80
|
// Fetch jobs from BullMQ scheduler-execution queue
|
|
81
81
|
const { Queue } = await import('bullmq')
|
|
82
|
-
const queue = new Queue('scheduler-execution', {
|
|
82
|
+
const queue = new Queue('scheduler-execution', {
|
|
83
|
+
connection: parseRedisUrl(getRedisUrlOrThrow('QUEUE')),
|
|
84
|
+
})
|
|
83
85
|
|
|
84
86
|
try {
|
|
85
87
|
// Validate query params with Zod schema
|
|
@@ -2,7 +2,7 @@ import { NextRequest, NextResponse } from 'next/server'
|
|
|
2
2
|
import { z } from 'zod'
|
|
3
3
|
import { getAuthFromRequest } from '@open-mercato/shared/lib/auth/server'
|
|
4
4
|
import type { OpenApiRouteDoc } from '@open-mercato/shared/lib/openapi'
|
|
5
|
-
import { getRedisUrlOrThrow } from '@open-mercato/shared/lib/redis/connection'
|
|
5
|
+
import { getRedisUrlOrThrow, parseRedisUrl } from '@open-mercato/shared/lib/redis/connection'
|
|
6
6
|
import { getModules } from '@open-mercato/shared/lib/modules/registry'
|
|
7
7
|
import { resolveTranslations } from '@open-mercato/shared/lib/i18n/server'
|
|
8
8
|
import { createLogger } from '@open-mercato/shared/lib/logger'
|
|
@@ -72,7 +72,9 @@ export async function GET(
|
|
|
72
72
|
|
|
73
73
|
// Fetch job from BullMQ
|
|
74
74
|
const { Queue } = await import('bullmq')
|
|
75
|
-
const queue = new Queue(queueName, {
|
|
75
|
+
const queue = new Queue(queueName, {
|
|
76
|
+
connection: parseRedisUrl(getRedisUrlOrThrow('QUEUE')),
|
|
77
|
+
})
|
|
76
78
|
|
|
77
79
|
const job = await queue.getJob(jobId)
|
|
78
80
|
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scheduler.action.create": "새 일정",
|
|
3
|
+
"scheduler.action.delete": "삭제",
|
|
4
|
+
"scheduler.action.edit": "편집",
|
|
5
|
+
"scheduler.action.refresh": "새로고침",
|
|
6
|
+
"scheduler.action.trigger": "지금 실행",
|
|
7
|
+
"scheduler.action.view": "보기",
|
|
8
|
+
"scheduler.audit.create": "일정 생성",
|
|
9
|
+
"scheduler.audit.delete": "일정 삭제",
|
|
10
|
+
"scheduler.audit.update": "일정 수정",
|
|
11
|
+
"scheduler.confirm.delete": "이 일정을 삭제하시겠습니까?",
|
|
12
|
+
"scheduler.confirm.trigger": "지금 \"{name}\"을(를) 실행하시겠습니까?\n\n{targetType}이(가) 즉시 실행됩니다.",
|
|
13
|
+
"scheduler.create.title": "일정 생성",
|
|
14
|
+
"scheduler.details.configuration": "구성",
|
|
15
|
+
"scheduler.details.error": "오류",
|
|
16
|
+
"scheduler.details.executions_async_only": "실행 기록 및 수동 실행은 비동기 큐 전략(QUEUE_STRATEGY=async)이 필요합니다.",
|
|
17
|
+
"scheduler.details.last_run": "마지막 실행",
|
|
18
|
+
"scheduler.details.no_executions": "아직 실행 기록이 없습니다",
|
|
19
|
+
"scheduler.details.not_found": "찾을 수 없음",
|
|
20
|
+
"scheduler.details.payload": "페이로드",
|
|
21
|
+
"scheduler.details.recent_executions": "최근 실행",
|
|
22
|
+
"scheduler.details.required_feature": "필요한 기능",
|
|
23
|
+
"scheduler.details.scope": "범위",
|
|
24
|
+
"scheduler.details.source_module": "모듈",
|
|
25
|
+
"scheduler.details.source_user": "사용자 생성",
|
|
26
|
+
"scheduler.details.triggering": "실행 중...",
|
|
27
|
+
"scheduler.edit.title": "일정 편집",
|
|
28
|
+
"scheduler.error.access_denied": "접근이 거부되었습니다",
|
|
29
|
+
"scheduler.error.active_schedule_limit": "이 테넌트({max})에 대한 활성 예약 작업 제한에 도달했습니다.",
|
|
30
|
+
"scheduler.error.async_strategy_hint": "실행 기록을 보려면 QUEUE_STRATEGY=async를 설정하세요",
|
|
31
|
+
"scheduler.error.async_strategy_required": "실행 기록에는 QUEUE_STRATEGY=async가 필요합니다",
|
|
32
|
+
"scheduler.error.bullmq_required": "BullMQ 작업 로그는 QUEUE_STRATEGY=async에서만 사용할 수 있습니다",
|
|
33
|
+
"scheduler.error.delete_failed": "일정 삭제에 실패했습니다",
|
|
34
|
+
"scheduler.error.fetch_executions_failed": "실행 기록을 가져오지 못했습니다",
|
|
35
|
+
"scheduler.error.fetch_failed": "일정을 불러오지 못했습니다",
|
|
36
|
+
"scheduler.error.fetch_job_failed": "작업 상세 정보를 가져오지 못했습니다",
|
|
37
|
+
"scheduler.error.forbidden": "접근이 거부되었습니다",
|
|
38
|
+
"scheduler.error.invalidPayload": "잘못된 JSON 페이로드입니다",
|
|
39
|
+
"scheduler.error.invalid_queue_name": "잘못된 큐 이름입니다",
|
|
40
|
+
"scheduler.error.invalid_schedule_value": "일정 값이 잘못되었습니다.",
|
|
41
|
+
"scheduler.error.job_not_found": "BullMQ에서 작업을 찾을 수 없습니다 (제거되었을 수 있음)",
|
|
42
|
+
"scheduler.error.load_failed": "일정을 불러오지 못했습니다",
|
|
43
|
+
"scheduler.error.not_found": "일정을 찾을 수 없습니다",
|
|
44
|
+
"scheduler.error.queue_param_required": "queue 매개변수가 필요합니다",
|
|
45
|
+
"scheduler.error.trigger_async_hint": "실행 기록 및 수동 실행은 BullMQ(비동기 전략)에서만 사용할 수 있습니다",
|
|
46
|
+
"scheduler.error.trigger_async_required": "수동 실행에는 QUEUE_STRATEGY=async가 필요합니다",
|
|
47
|
+
"scheduler.error.trigger_failed": "일정 실행에 실패했습니다",
|
|
48
|
+
"scheduler.error.unauthorized": "권한이 없습니다",
|
|
49
|
+
"scheduler.error.update_failed": "일정 수정에 실패했습니다",
|
|
50
|
+
"scheduler.errors.id_required": "일정 식별자는 필수입니다.",
|
|
51
|
+
"scheduler.execution.actions": "작업",
|
|
52
|
+
"scheduler.execution.completed_message": "이 실행은 오류 없이 성공적으로 완료되었습니다.",
|
|
53
|
+
"scheduler.execution.details_title": "실행 상세 정보",
|
|
54
|
+
"scheduler.execution.duration": "소요 시간",
|
|
55
|
+
"scheduler.execution.error_message": "오류 메시지",
|
|
56
|
+
"scheduler.execution.finished_at": "완료 시각",
|
|
57
|
+
"scheduler.execution.na": "해당 없음",
|
|
58
|
+
"scheduler.execution.queue_job_id": "큐 작업 ID",
|
|
59
|
+
"scheduler.execution.queue_name": "큐 이름",
|
|
60
|
+
"scheduler.execution.run_id": "실행 ID",
|
|
61
|
+
"scheduler.execution.running_message": "이 실행은 현재 진행 중입니다.",
|
|
62
|
+
"scheduler.execution.skipped_message": "이 실행은 건너뛰어졌습니다.",
|
|
63
|
+
"scheduler.execution.stack_trace": "스택 추적",
|
|
64
|
+
"scheduler.execution.started": "시작됨",
|
|
65
|
+
"scheduler.execution.started_at": "시작 시각",
|
|
66
|
+
"scheduler.execution.status": "상태",
|
|
67
|
+
"scheduler.execution.trigger": "트리거",
|
|
68
|
+
"scheduler.execution.trigger_type": "트리거 유형",
|
|
69
|
+
"scheduler.execution.view_details": "상세 정보 보기",
|
|
70
|
+
"scheduler.execution.view_logs": "로그 보기",
|
|
71
|
+
"scheduler.execution_status.completed": "완료됨",
|
|
72
|
+
"scheduler.execution_status.failed": "실패",
|
|
73
|
+
"scheduler.execution_status.running": "실행 중",
|
|
74
|
+
"scheduler.execution_status.skipped": "건너뜀",
|
|
75
|
+
"scheduler.execution_status.waiting": "대기 중",
|
|
76
|
+
"scheduler.field.active": "활성",
|
|
77
|
+
"scheduler.field.description": "설명",
|
|
78
|
+
"scheduler.field.name": "이름",
|
|
79
|
+
"scheduler.field.next_run": "다음 실행",
|
|
80
|
+
"scheduler.field.schedule": "일정",
|
|
81
|
+
"scheduler.field.schedule_type": "유형",
|
|
82
|
+
"scheduler.field.schedule_value": "일정 값",
|
|
83
|
+
"scheduler.field.source": "소스",
|
|
84
|
+
"scheduler.field.status": "상태",
|
|
85
|
+
"scheduler.field.target": "대상",
|
|
86
|
+
"scheduler.field.timezone": "표준 시간대",
|
|
87
|
+
"scheduler.form.description": "설명",
|
|
88
|
+
"scheduler.form.disabled": "비활성화됨",
|
|
89
|
+
"scheduler.form.enabled": "활성화됨",
|
|
90
|
+
"scheduler.form.group.basic": "기본 정보",
|
|
91
|
+
"scheduler.form.group.schedule": "일정 구성",
|
|
92
|
+
"scheduler.form.group.target": "대상 구성",
|
|
93
|
+
"scheduler.form.is_enabled": "활성화됨",
|
|
94
|
+
"scheduler.form.name": "이름",
|
|
95
|
+
"scheduler.form.name.required": "이름은 필수입니다",
|
|
96
|
+
"scheduler.form.save": "변경 사항 저장",
|
|
97
|
+
"scheduler.form.schedule": "일정",
|
|
98
|
+
"scheduler.form.schedule.required": "일정은 필수입니다",
|
|
99
|
+
"scheduler.form.schedule_type": "일정 유형",
|
|
100
|
+
"scheduler.form.schedule_value": "일정 값",
|
|
101
|
+
"scheduler.form.schedule_value.description": "cron: cron 표현식을 사용하세요 (예: \"0 0 * * *\"). interval: \"15m\", \"2h\", \"1d\"와 같은 형식을 사용하세요 (s=초, m=분, h=시간, d=일)",
|
|
102
|
+
"scheduler.form.schedule_value.placeholder": "예: 0 */6 * * * 또는 15m",
|
|
103
|
+
"scheduler.form.scope_type": "범위",
|
|
104
|
+
"scheduler.form.scope_type.locked_description": "범위는 일정이 생성될 때 설정되며 이후에는 변경할 수 없습니다.",
|
|
105
|
+
"scheduler.form.submit": "일정 생성",
|
|
106
|
+
"scheduler.form.target_command": "대상 명령",
|
|
107
|
+
"scheduler.form.target_command.placeholder": "명령 검색...",
|
|
108
|
+
"scheduler.form.target_payload": "작업 인수 (JSON)",
|
|
109
|
+
"scheduler.form.target_payload.description": "명령이나 큐 작업에 전달할 인수가 담긴 선택적 JSON 객체입니다. 유효한 JSON 형식이어야 합니다.",
|
|
110
|
+
"scheduler.form.target_payload.invalid_json": "유효한 JSON이어야 합니다",
|
|
111
|
+
"scheduler.form.target_payload.placeholder": "{\n \"message\": \"Hello\",\n \"value\": 42\n}",
|
|
112
|
+
"scheduler.form.target_queue": "대상 큐",
|
|
113
|
+
"scheduler.form.target_queue.placeholder": "큐 검색...",
|
|
114
|
+
"scheduler.form.target_type": "대상 유형",
|
|
115
|
+
"scheduler.form.timezone": "표준 시간대",
|
|
116
|
+
"scheduler.form.timezone.placeholder": "표준 시간대 검색...",
|
|
117
|
+
"scheduler.job_logs.attempts": "시도 횟수",
|
|
118
|
+
"scheduler.job_logs.duration": "소요 시간",
|
|
119
|
+
"scheduler.job_logs.error_message": "오류 메시지",
|
|
120
|
+
"scheduler.job_logs.finished": "완료됨",
|
|
121
|
+
"scheduler.job_logs.job_id": "작업 ID",
|
|
122
|
+
"scheduler.job_logs.load_failed": "작업 상세 정보를 불러오지 못했습니다",
|
|
123
|
+
"scheduler.job_logs.no_logs": "사용 가능한 로그가 없습니다",
|
|
124
|
+
"scheduler.job_logs.processed": "처리됨",
|
|
125
|
+
"scheduler.job_logs.progress": "진행 상황",
|
|
126
|
+
"scheduler.job_logs.return_value": "반환 값",
|
|
127
|
+
"scheduler.job_logs.stack_trace": "스택 추적",
|
|
128
|
+
"scheduler.job_logs.state": "상태",
|
|
129
|
+
"scheduler.job_logs.tab_error": "오류 상세 정보",
|
|
130
|
+
"scheduler.job_logs.tab_logs": "로그",
|
|
131
|
+
"scheduler.job_logs.tab_overview": "개요",
|
|
132
|
+
"scheduler.job_logs.tab_payload": "페이로드",
|
|
133
|
+
"scheduler.job_logs.title": "큐 작업",
|
|
134
|
+
"scheduler.loading": "일정을 불러오는 중...",
|
|
135
|
+
"scheduler.module.description": "cron 표현식이나 간단한 간격으로 자동화된 예약 작업을 관리합니다.",
|
|
136
|
+
"scheduler.module.title": "예약된 작업",
|
|
137
|
+
"scheduler.nav.backToList": "예약된 작업으로 돌아가기",
|
|
138
|
+
"scheduler.scope.organization": "조직",
|
|
139
|
+
"scheduler.scope.system": "시스템",
|
|
140
|
+
"scheduler.scope.tenant": "테넌트",
|
|
141
|
+
"scheduler.search.placeholder": "일정 검색...",
|
|
142
|
+
"scheduler.status.disabled": "비활성화됨",
|
|
143
|
+
"scheduler.status.enabled": "활성화됨",
|
|
144
|
+
"scheduler.success.created": "일정이 성공적으로 생성되었습니다",
|
|
145
|
+
"scheduler.success.deleted": "일정이 성공적으로 삭제되었습니다",
|
|
146
|
+
"scheduler.success.disabled": "일정이 비활성화되었습니다",
|
|
147
|
+
"scheduler.success.enabled": "일정이 활성화되었습니다",
|
|
148
|
+
"scheduler.success.triggered": "일정이 성공적으로 실행되었습니다",
|
|
149
|
+
"scheduler.success.updated": "일정이 성공적으로 수정되었습니다",
|
|
150
|
+
"scheduler.target.command": "명령",
|
|
151
|
+
"scheduler.target.queue": "큐",
|
|
152
|
+
"scheduler.title": "예약된 작업",
|
|
153
|
+
"scheduler.trigger_type.manual": "수동",
|
|
154
|
+
"scheduler.trigger_type.scheduled": "예약됨",
|
|
155
|
+
"scheduler.type.cron": "Cron 표현식",
|
|
156
|
+
"scheduler.type.interval": "간단한 간격"
|
|
157
|
+
}
|