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

Method triggerJob

src/runtime/adapters/scheduler.ts:479–503  ·  view source on GitHub ↗

* Manually trigger a job (runs immediately, ignoring cron schedule).

(id: string)

Source from the content-addressed store, hash-verified

477 };
478 }
479
480 /**
481 * Manually trigger a job (runs immediately, ignoring cron schedule).
482 */
483 async triggerJob(id: string): Promise<{ success: boolean; message: string }> {
484 const job = this.jobs.get(id);
485 if (!job) {
486 return { success: false, message: `Job "${id}" not found.` };
487 }
488
489 const { text, notifyFailed } = await this.runJob(job.config);
490
491 if (!text) {
492 return {
493 success: true,
494 message: `Job "${job.config.name}" triggered but produced no output.`,
495 };
496 }
497 if (notifyFailed) {
498 return {
499 success: true,
500 message: `Job "${job.config.name}" executed, but notification to ${job.config.notify.adapter} failed. Check logs.`,
501 };
502 }
503 return {
504 success: true,
505 message: `Job "${job.config.name}" triggered. Result sent to ${job.config.notify.adapter}.`,
506 };

Callers 4

executeFunction · 0.80
handleRequestMethod · 0.80
startMethod · 0.80
scheduler.test.tsFile · 0.80

Calls 1

runJobMethod · 0.95

Tested by

no test coverage detected