MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / updateJob

Method updateJob

src/runtime/adapters/scheduler.ts:406–436  ·  view source on GitHub ↗
(
    id: string,
    updates: Omit<ScheduledJobConfig, "id" | "name">,
  )

Source from the content-addressed store, hash-verified

404 this.removeFromMap(id);
405 this.persistJobs();
406
407 return { success: true, message: `Job "${job.config.name}" removed.` };
408 }
409
410 updateJob(
411 id: string,
412 updates: ScheduledJobUpdate,
413 ): { success: boolean; message: string } {
414 const job = this.jobs.get(id);
415 if (!job) {
416 return { success: false, message: `Job "${id}" not found.` };
417 }
418
419 const nextConfig: ScheduledJobConfig = {
420 id: job.config.id,
421 name: updates.name ?? job.config.name,
422 cron: updates.cron,
423 prompt: updates.prompt,
424 promptExamples: updates.promptExamples,
425 notify: updates.notify,
426 enabled: updates.enabled,
427 timezone: updates.timezone,
428 };
429
430 const result = this.registerJob(nextConfig);
431 if (!result.registered) {
432 return { success: false, message: result.message };
433 }
434
435 this.persistJobs();
436 return {
437 success: true,
438 message: `Job "${nextConfig.name}" updated.`,
439 };

Callers 2

handleRequestMethod · 0.80
scheduler.test.tsFile · 0.80

Calls 2

registerJobMethod · 0.95
persistJobsMethod · 0.95

Tested by

no test coverage detected