@open-mercato/scheduler 0.6.6-develop.6465.1.019f0fb26f → 0.6.6-develop.6472.1.1673e7e66b
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 +3 -1
- package/dist/modules/scheduler/api/jobs/[id]/executions/route.js.map +2 -2
- package/dist/modules/scheduler/api/queue-jobs/[jobId]/route.js +3 -1
- package/dist/modules/scheduler/api/queue-jobs/[jobId]/route.js.map +2 -2
- package/dist/modules/scheduler/api/trigger/route.js +4 -2
- package/dist/modules/scheduler/api/trigger/route.js.map +2 -2
- package/dist/modules/scheduler/cli.js +55 -50
- package/dist/modules/scheduler/cli.js.map +2 -2
- package/dist/modules/scheduler/commands/test-echo.js +3 -2
- package/dist/modules/scheduler/commands/test-echo.js.map +2 -2
- package/dist/modules/scheduler/di.js +4 -2
- package/dist/modules/scheduler/di.js.map +2 -2
- package/dist/modules/scheduler/lib/localLockStrategy.js +3 -1
- package/dist/modules/scheduler/lib/localLockStrategy.js.map +2 -2
- package/dist/modules/scheduler/lib/scheduledJobSubscriber.js +8 -6
- package/dist/modules/scheduler/lib/scheduledJobSubscriber.js.map +2 -2
- package/dist/modules/scheduler/services/bullmqSchedulerService.js +20 -17
- package/dist/modules/scheduler/services/bullmqSchedulerService.js.map +2 -2
- package/dist/modules/scheduler/services/localSchedulerService.js +21 -19
- package/dist/modules/scheduler/services/localSchedulerService.js.map +2 -2
- package/dist/modules/scheduler/services/schedulerService.js +5 -3
- package/dist/modules/scheduler/services/schedulerService.js.map +2 -2
- package/dist/modules/scheduler/workers/execute-schedule.worker.js +16 -15
- package/dist/modules/scheduler/workers/execute-schedule.worker.js.map +2 -2
- package/package.json +5 -5
- package/src/modules/scheduler/api/jobs/[id]/executions/route.ts +4 -1
- package/src/modules/scheduler/api/queue-jobs/[jobId]/route.ts +4 -1
- package/src/modules/scheduler/api/trigger/route.ts +5 -2
- package/src/modules/scheduler/cli.ts +55 -48
- package/src/modules/scheduler/commands/test-echo.ts +4 -2
- package/src/modules/scheduler/di.ts +6 -3
- package/src/modules/scheduler/lib/localLockStrategy.ts +4 -1
- package/src/modules/scheduler/lib/scheduledJobSubscriber.ts +9 -6
- package/src/modules/scheduler/services/__tests__/bullmqSchedulerService.test.ts +49 -74
- package/src/modules/scheduler/services/__tests__/localSchedulerService.test.ts +29 -67
- package/src/modules/scheduler/services/__tests__/schedulerService.test.ts +24 -9
- package/src/modules/scheduler/services/bullmqSchedulerService.ts +20 -16
- package/src/modules/scheduler/services/localSchedulerService.ts +22 -19
- package/src/modules/scheduler/services/schedulerService.ts +6 -3
- package/src/modules/scheduler/workers/execute-schedule.worker.ts +16 -14
|
@@ -4,6 +4,9 @@ import { recalculateNextRun } from '../lib/nextRunCalculator'
|
|
|
4
4
|
import { parseCronExpression } from '../lib/cronParser'
|
|
5
5
|
import { parseInterval } from '../lib/intervalParser'
|
|
6
6
|
import { getRedisUrlOrThrow } from '@open-mercato/shared/lib/redis/connection'
|
|
7
|
+
import { createLogger } from '@open-mercato/shared/lib/logger'
|
|
8
|
+
|
|
9
|
+
const logger = createLogger('scheduler').child({ component: 'bullmq' })
|
|
7
10
|
|
|
8
11
|
interface BullRepeatableJob {
|
|
9
12
|
key: string
|
|
@@ -106,7 +109,7 @@ export class BullMQSchedulerService {
|
|
|
106
109
|
*/
|
|
107
110
|
async register(schedule: ScheduledJob, options: { skipNextRunUpdate?: boolean } = {}): Promise<void> {
|
|
108
111
|
if (!schedule.isEnabled) {
|
|
109
|
-
|
|
112
|
+
logger.debug('Skipping disabled schedule', { scheduleId: schedule.id })
|
|
110
113
|
return
|
|
111
114
|
}
|
|
112
115
|
|
|
@@ -151,14 +154,13 @@ export class BullMQSchedulerService {
|
|
|
151
154
|
createdAt: new Date().toISOString(),
|
|
152
155
|
}
|
|
153
156
|
|
|
154
|
-
|
|
157
|
+
logger.debug('Adding repeatable job', {
|
|
155
158
|
jobName,
|
|
156
159
|
scheduleId: schedule.id,
|
|
157
160
|
scopeType: schedule.scopeType,
|
|
158
161
|
tenantId: schedule.tenantId,
|
|
159
162
|
organizationId: schedule.organizationId,
|
|
160
163
|
repeatOpts,
|
|
161
|
-
jobData,
|
|
162
164
|
})
|
|
163
165
|
|
|
164
166
|
await queue.add(
|
|
@@ -178,13 +180,15 @@ export class BullMQSchedulerService {
|
|
|
178
180
|
}
|
|
179
181
|
)
|
|
180
182
|
|
|
181
|
-
|
|
183
|
+
logger.debug('Registered schedule', {
|
|
184
|
+
scheduleId: schedule.id,
|
|
185
|
+
scheduleName: schedule.name,
|
|
182
186
|
type: schedule.scheduleType,
|
|
183
187
|
pattern: schedule.scheduleValue,
|
|
184
188
|
timezone: schedule.timezone,
|
|
185
189
|
})
|
|
186
190
|
} catch (error: unknown) {
|
|
187
|
-
|
|
191
|
+
logger.error('Failed to register schedule', { scheduleId: schedule.id, err: error })
|
|
188
192
|
throw error
|
|
189
193
|
}
|
|
190
194
|
}
|
|
@@ -198,12 +202,12 @@ export class BullMQSchedulerService {
|
|
|
198
202
|
|
|
199
203
|
const removed = await this.removeRepeatableJobsForSchedule(queue, scheduleId)
|
|
200
204
|
if (removed > 0) {
|
|
201
|
-
|
|
205
|
+
logger.debug('Unregistered schedule', { scheduleId })
|
|
202
206
|
} else {
|
|
203
|
-
|
|
207
|
+
logger.debug('No repeatable job found for schedule', { scheduleId })
|
|
204
208
|
}
|
|
205
209
|
} catch (error: unknown) {
|
|
206
|
-
|
|
210
|
+
logger.error('Failed to unregister schedule', { scheduleId, err: error })
|
|
207
211
|
throw error
|
|
208
212
|
}
|
|
209
213
|
}
|
|
@@ -216,7 +220,7 @@ export class BullMQSchedulerService {
|
|
|
216
220
|
const em = this.em().fork()
|
|
217
221
|
const queue = await this.getQueue()
|
|
218
222
|
|
|
219
|
-
|
|
223
|
+
logger.debug('Starting full sync')
|
|
220
224
|
|
|
221
225
|
// Get all BullMQ repeatable jobs
|
|
222
226
|
const repeatableJobs = await queue.getRepeatableJobs?.() || []
|
|
@@ -248,10 +252,10 @@ export class BullMQSchedulerService {
|
|
|
248
252
|
// Register schedules that exist in DB but not in BullMQ
|
|
249
253
|
for (const schedule of dbSchedules) {
|
|
250
254
|
if (!bullmqScheduleIds.has(schedule.id)) {
|
|
251
|
-
|
|
255
|
+
logger.debug('Registering missing schedule', { scheduleId: schedule.id, scheduleName: schedule.name })
|
|
252
256
|
await this.register(schedule)
|
|
253
257
|
} else if ((bullmqScheduleCounts.get(schedule.id) ?? 0) > 1) {
|
|
254
|
-
|
|
258
|
+
logger.info('Repairing duplicate repeatable jobs', { scheduleId: schedule.id })
|
|
255
259
|
await this.register(schedule)
|
|
256
260
|
}
|
|
257
261
|
}
|
|
@@ -259,12 +263,12 @@ export class BullMQSchedulerService {
|
|
|
259
263
|
// Remove BullMQ jobs that don't exist in DB or are disabled
|
|
260
264
|
for (const scheduleId of bullmqScheduleIds) {
|
|
261
265
|
if (!dbScheduleIds.has(scheduleId)) {
|
|
262
|
-
|
|
266
|
+
logger.info('Removing orphaned schedule', { scheduleId })
|
|
263
267
|
await this.unregister(String(scheduleId))
|
|
264
268
|
}
|
|
265
269
|
}
|
|
266
270
|
|
|
267
|
-
|
|
271
|
+
logger.debug('Sync complete', { activeSchedules: dbSchedules.length })
|
|
268
272
|
}
|
|
269
273
|
|
|
270
274
|
/**
|
|
@@ -301,7 +305,7 @@ export class BullMQSchedulerService {
|
|
|
301
305
|
const queue = await this.getQueue()
|
|
302
306
|
return await queue.getRepeatableJobs?.() || []
|
|
303
307
|
} catch (error) {
|
|
304
|
-
|
|
308
|
+
logger.error('Failed to get repeatable jobs', { err: error })
|
|
305
309
|
return []
|
|
306
310
|
}
|
|
307
311
|
}
|
|
@@ -315,9 +319,9 @@ export class BullMQSchedulerService {
|
|
|
315
319
|
try {
|
|
316
320
|
await this.queue.close()
|
|
317
321
|
this.queue = null
|
|
318
|
-
|
|
322
|
+
logger.debug('Queue connection closed')
|
|
319
323
|
} catch (error) {
|
|
320
|
-
|
|
324
|
+
logger.error('Error closing queue', { err: error })
|
|
321
325
|
}
|
|
322
326
|
}
|
|
323
327
|
}
|
|
@@ -8,6 +8,9 @@ import { recalculateNextRun } from '../lib/nextRunCalculator'
|
|
|
8
8
|
import { emitSchedulerEvent } from '../events.js'
|
|
9
9
|
import { getGlobalEventBus } from '@open-mercato/shared/modules/events'
|
|
10
10
|
import { buildScheduledCommandContext } from '../lib/commandContext.js'
|
|
11
|
+
import { createLogger } from '@open-mercato/shared/lib/logger'
|
|
12
|
+
|
|
13
|
+
const logger = createLogger('scheduler').child({ component: 'local' })
|
|
11
14
|
|
|
12
15
|
export interface RbacServiceLike {
|
|
13
16
|
tenantHasFeature(tenantId: string | null | undefined, feature: string, opts?: { organizationId?: string | null }): Promise<boolean>
|
|
@@ -56,13 +59,12 @@ export class LocalSchedulerService {
|
|
|
56
59
|
*/
|
|
57
60
|
async start(): Promise<void> {
|
|
58
61
|
if (this.isRunning) {
|
|
59
|
-
|
|
62
|
+
logger.warn('Polling engine already running')
|
|
60
63
|
return
|
|
61
64
|
}
|
|
62
65
|
|
|
63
66
|
this.isRunning = true
|
|
64
|
-
|
|
65
|
-
console.log(`[scheduler:local] Poll interval: ${this.config.pollIntervalMs}ms`)
|
|
67
|
+
logger.info('Starting polling engine', { pollIntervalMs: this.config.pollIntervalMs })
|
|
66
68
|
|
|
67
69
|
// Run initial poll immediately
|
|
68
70
|
await this.poll()
|
|
@@ -70,18 +72,18 @@ export class LocalSchedulerService {
|
|
|
70
72
|
// Schedule recurring polls
|
|
71
73
|
this.pollTimer = setInterval(() => {
|
|
72
74
|
this.poll().catch((error) => {
|
|
73
|
-
|
|
75
|
+
logger.error('Poll error', { err: error })
|
|
74
76
|
})
|
|
75
77
|
}, this.config.pollIntervalMs)
|
|
76
78
|
|
|
77
|
-
|
|
79
|
+
logger.info('Polling engine started')
|
|
78
80
|
}
|
|
79
81
|
|
|
80
82
|
/**
|
|
81
83
|
* Stop the local scheduler
|
|
82
84
|
*/
|
|
83
85
|
async stop(): Promise<void> {
|
|
84
|
-
|
|
86
|
+
logger.info('Stopping polling engine')
|
|
85
87
|
this.isRunning = false
|
|
86
88
|
|
|
87
89
|
if (this.pollTimer) {
|
|
@@ -89,7 +91,7 @@ export class LocalSchedulerService {
|
|
|
89
91
|
this.pollTimer = undefined
|
|
90
92
|
}
|
|
91
93
|
|
|
92
|
-
|
|
94
|
+
logger.info('Polling engine stopped')
|
|
93
95
|
}
|
|
94
96
|
|
|
95
97
|
/**
|
|
@@ -114,18 +116,18 @@ export class LocalSchedulerService {
|
|
|
114
116
|
})
|
|
115
117
|
|
|
116
118
|
if (dueSchedules.length === 0) {
|
|
117
|
-
|
|
119
|
+
logger.debug('No due schedules')
|
|
118
120
|
return
|
|
119
121
|
}
|
|
120
122
|
|
|
121
|
-
|
|
123
|
+
logger.info('Found due schedules', { count: dueSchedules.length })
|
|
122
124
|
|
|
123
125
|
// Execute each schedule
|
|
124
126
|
for (const schedule of dueSchedules) {
|
|
125
127
|
await this.executeSchedule(schedule)
|
|
126
128
|
}
|
|
127
129
|
} catch (error: unknown) {
|
|
128
|
-
|
|
130
|
+
logger.error('Poll failed', { err: error })
|
|
129
131
|
}
|
|
130
132
|
}
|
|
131
133
|
|
|
@@ -134,9 +136,10 @@ export class LocalSchedulerService {
|
|
|
134
136
|
*/
|
|
135
137
|
private async executeSchedule(schedule: ScheduledJob): Promise<void> {
|
|
136
138
|
const lockKey = `schedule:${schedule.id}`
|
|
139
|
+
const scheduleLogger = logger.child({ scheduleId: schedule.id, scheduleName: schedule.name })
|
|
137
140
|
|
|
138
141
|
const { acquired } = await this.lockStrategy.runWithLock(lockKey, async () => {
|
|
139
|
-
|
|
142
|
+
scheduleLogger.info('Executing schedule')
|
|
140
143
|
|
|
141
144
|
// Emit started event
|
|
142
145
|
await emitSchedulerEvent('scheduler.job.started', {
|
|
@@ -155,7 +158,7 @@ export class LocalSchedulerService {
|
|
|
155
158
|
const hasFeature = await this.checkFeature(schedule)
|
|
156
159
|
|
|
157
160
|
if (!hasFeature) {
|
|
158
|
-
|
|
161
|
+
scheduleLogger.info('Schedule skipped: missing required feature', { requireFeature: schedule.requireFeature })
|
|
159
162
|
|
|
160
163
|
await emitSchedulerEvent('scheduler.job.skipped', {
|
|
161
164
|
id: schedule.id,
|
|
@@ -203,7 +206,7 @@ export class LocalSchedulerService {
|
|
|
203
206
|
await em.flush()
|
|
204
207
|
}
|
|
205
208
|
|
|
206
|
-
|
|
209
|
+
scheduleLogger.info('Schedule completed')
|
|
207
210
|
|
|
208
211
|
// Emit completed event
|
|
209
212
|
await emitSchedulerEvent('scheduler.job.completed', {
|
|
@@ -215,7 +218,7 @@ export class LocalSchedulerService {
|
|
|
215
218
|
completedAt: new Date(),
|
|
216
219
|
})
|
|
217
220
|
} catch (error: unknown) {
|
|
218
|
-
|
|
221
|
+
scheduleLogger.error('Schedule failed', { err: error })
|
|
219
222
|
|
|
220
223
|
// Emit failed event
|
|
221
224
|
await emitSchedulerEvent('scheduler.job.failed', {
|
|
@@ -234,7 +237,7 @@ export class LocalSchedulerService {
|
|
|
234
237
|
})
|
|
235
238
|
|
|
236
239
|
if (!acquired) {
|
|
237
|
-
|
|
240
|
+
scheduleLogger.debug('Schedule already locked, skipping')
|
|
238
241
|
return
|
|
239
242
|
}
|
|
240
243
|
}
|
|
@@ -259,7 +262,7 @@ export class LocalSchedulerService {
|
|
|
259
262
|
triggeredAt: new Date(),
|
|
260
263
|
})
|
|
261
264
|
|
|
262
|
-
|
|
265
|
+
logger.info('Enqueued job to target queue', { scheduleId: schedule.id, targetQueue: schedule.targetQueue })
|
|
263
266
|
}
|
|
264
267
|
|
|
265
268
|
/**
|
|
@@ -291,12 +294,12 @@ export class LocalSchedulerService {
|
|
|
291
294
|
} as AppContainer,
|
|
292
295
|
)
|
|
293
296
|
|
|
294
|
-
|
|
297
|
+
await commandBus.execute(schedule.targetCommand, {
|
|
295
298
|
input: commandInput,
|
|
296
299
|
ctx: commandCtx,
|
|
297
300
|
})
|
|
298
301
|
|
|
299
|
-
|
|
302
|
+
logger.info('Executed command', { scheduleId: schedule.id, targetCommand: schedule.targetCommand })
|
|
300
303
|
}
|
|
301
304
|
|
|
302
305
|
/**
|
|
@@ -326,7 +329,7 @@ export class LocalSchedulerService {
|
|
|
326
329
|
|
|
327
330
|
return hasFeature
|
|
328
331
|
} catch (error: unknown) {
|
|
329
|
-
|
|
332
|
+
logger.error('Feature check failed', { scheduleId: schedule.id, err: error })
|
|
330
333
|
return false
|
|
331
334
|
}
|
|
332
335
|
}
|
|
@@ -2,6 +2,9 @@ import type { EntityManager } from '@mikro-orm/core'
|
|
|
2
2
|
import { ScheduledJob } from '../data/entities.js'
|
|
3
3
|
import { calculateNextRun } from '../lib/nextRunCalculator.js'
|
|
4
4
|
import type { BullMQSchedulerService } from './bullmqSchedulerService.js'
|
|
5
|
+
import { createLogger } from '@open-mercato/shared/lib/logger'
|
|
6
|
+
|
|
7
|
+
const logger = createLogger('scheduler')
|
|
5
8
|
|
|
6
9
|
export interface ScheduleRegistration {
|
|
7
10
|
id: string
|
|
@@ -113,7 +116,7 @@ export class SchedulerService {
|
|
|
113
116
|
await this.bullmqService.unregister(schedule.id)
|
|
114
117
|
}
|
|
115
118
|
} catch (error: unknown) {
|
|
116
|
-
|
|
119
|
+
logger.error('Failed to sync with BullMQ', { scheduleId: schedule.id, err: error })
|
|
117
120
|
// Don't throw - DB is source of truth, BullMQ sync is best-effort
|
|
118
121
|
}
|
|
119
122
|
}
|
|
@@ -134,7 +137,7 @@ export class SchedulerService {
|
|
|
134
137
|
try {
|
|
135
138
|
await this.bullmqService.unregister(scheduleId)
|
|
136
139
|
} catch (error: unknown) {
|
|
137
|
-
|
|
140
|
+
logger.error('Failed to unregister from BullMQ', { scheduleId, err: error })
|
|
138
141
|
}
|
|
139
142
|
}
|
|
140
143
|
}
|
|
@@ -218,7 +221,7 @@ export class SchedulerService {
|
|
|
218
221
|
await this.bullmqService.unregister(scheduleId)
|
|
219
222
|
}
|
|
220
223
|
} catch (error: unknown) {
|
|
221
|
-
|
|
224
|
+
logger.error('Failed to sync update with BullMQ', { scheduleId, err: error })
|
|
222
225
|
}
|
|
223
226
|
}
|
|
224
227
|
}
|
|
@@ -7,6 +7,9 @@ import { CommandBus } from '@open-mercato/shared/lib/commands'
|
|
|
7
7
|
import type { AppContainer } from '@open-mercato/shared/lib/di/container'
|
|
8
8
|
import { emitSchedulerEvent } from '../events.js'
|
|
9
9
|
import { buildScheduledCommandContext } from '../lib/commandContext.js'
|
|
10
|
+
import { createLogger } from '@open-mercato/shared/lib/logger'
|
|
11
|
+
|
|
12
|
+
const logger = createLogger('scheduler').child({ component: 'worker' })
|
|
10
13
|
|
|
11
14
|
// Worker metadata for auto-discovery
|
|
12
15
|
export const metadata: WorkerMeta = {
|
|
@@ -55,7 +58,7 @@ export default async function executeScheduleWorker(
|
|
|
55
58
|
job: QueuedJob<ExecuteSchedulePayload>,
|
|
56
59
|
ctx: JobContext & HandlerContext,
|
|
57
60
|
): Promise<void> {
|
|
58
|
-
|
|
61
|
+
logger.debug('Processing job', {
|
|
59
62
|
jobId: ctx.jobId,
|
|
60
63
|
attemptNumber: ctx.attemptNumber,
|
|
61
64
|
})
|
|
@@ -64,10 +67,7 @@ export default async function executeScheduleWorker(
|
|
|
64
67
|
const payload = (job.payload || (job as unknown as { data?: ExecuteSchedulePayload }).data) as ExecuteSchedulePayload | undefined
|
|
65
68
|
|
|
66
69
|
if (!payload || !payload.scheduleId) {
|
|
67
|
-
|
|
68
|
-
jobId: ctx.jobId,
|
|
69
|
-
payload: job.payload,
|
|
70
|
-
})
|
|
70
|
+
logger.error('Invalid job payload: scheduleId missing', { jobId: ctx.jobId })
|
|
71
71
|
throw new Error('scheduleId is required in job payload')
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -83,14 +83,15 @@ export default async function executeScheduleWorker(
|
|
|
83
83
|
})
|
|
84
84
|
|
|
85
85
|
if (!schedule) {
|
|
86
|
-
|
|
86
|
+
logger.info('Schedule not found or deleted', { scheduleId })
|
|
87
87
|
return
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
// CRITICAL: Verify scope integrity - ensure payload scope matches database
|
|
91
91
|
// This prevents scope tampering and ensures proper multi-tenant isolation
|
|
92
92
|
if (payload.scopeType !== schedule.scopeType) {
|
|
93
|
-
|
|
93
|
+
logger.error('Scope type mismatch for schedule', {
|
|
94
|
+
scheduleId,
|
|
94
95
|
payloadScope: payload.scopeType,
|
|
95
96
|
dbScope: schedule.scopeType,
|
|
96
97
|
})
|
|
@@ -98,7 +99,8 @@ export default async function executeScheduleWorker(
|
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
if (payload.tenantId !== schedule.tenantId) {
|
|
101
|
-
|
|
102
|
+
logger.error('Tenant ID mismatch for schedule', {
|
|
103
|
+
scheduleId,
|
|
102
104
|
payloadTenant: payload.tenantId,
|
|
103
105
|
dbTenant: schedule.tenantId,
|
|
104
106
|
})
|
|
@@ -106,7 +108,8 @@ export default async function executeScheduleWorker(
|
|
|
106
108
|
}
|
|
107
109
|
|
|
108
110
|
if (payload.organizationId !== schedule.organizationId) {
|
|
109
|
-
|
|
111
|
+
logger.error('Organization ID mismatch for schedule', {
|
|
112
|
+
scheduleId,
|
|
110
113
|
payloadOrg: payload.organizationId,
|
|
111
114
|
dbOrg: schedule.organizationId,
|
|
112
115
|
})
|
|
@@ -115,7 +118,7 @@ export default async function executeScheduleWorker(
|
|
|
115
118
|
|
|
116
119
|
// Check if schedule is still enabled
|
|
117
120
|
if (!schedule.isEnabled) {
|
|
118
|
-
|
|
121
|
+
logger.debug('Schedule is disabled', { scheduleId })
|
|
119
122
|
await emitSchedulerEvent('scheduler.job.skipped', {
|
|
120
123
|
id: schedule.id,
|
|
121
124
|
tenantId: schedule.tenantId,
|
|
@@ -150,7 +153,7 @@ export default async function executeScheduleWorker(
|
|
|
150
153
|
reason: `Feature not enabled: ${schedule.requireFeature}`,
|
|
151
154
|
})
|
|
152
155
|
|
|
153
|
-
|
|
156
|
+
logger.debug('Schedule skipped: feature not enabled', { scheduleId, requireFeature: schedule.requireFeature })
|
|
154
157
|
return
|
|
155
158
|
}
|
|
156
159
|
}
|
|
@@ -196,7 +199,7 @@ export default async function executeScheduleWorker(
|
|
|
196
199
|
queueName: schedule.targetQueue,
|
|
197
200
|
})
|
|
198
201
|
|
|
199
|
-
|
|
202
|
+
logger.debug('Successfully enqueued job', {
|
|
200
203
|
scheduleId: schedule.id,
|
|
201
204
|
targetQueue: schedule.targetQueue,
|
|
202
205
|
queueJobId: targetJobId,
|
|
@@ -230,10 +233,9 @@ export default async function executeScheduleWorker(
|
|
|
230
233
|
commandResult: commandResult.result,
|
|
231
234
|
})
|
|
232
235
|
|
|
233
|
-
|
|
236
|
+
logger.debug('Successfully executed command', {
|
|
234
237
|
scheduleId: schedule.id,
|
|
235
238
|
commandId: schedule.targetCommand,
|
|
236
|
-
result: commandResult.result,
|
|
237
239
|
})
|
|
238
240
|
|
|
239
241
|
} else {
|