Schedo.dev provides basic monitoring capabilities for your scheduled jobs.
Job Status
Track basic job execution status:
schedo.defineJob(
'example-job',
'* * * * *',
async (ctx) => {
// Job implementation
return 'Job completed successfully';
}
);
Execution Context
Access basic execution information in the job context:
schedo.defineJob(
'context-example',
'0 * * * *',
async (ctx) => {
// Access execution context
console.log('Job execution:', {
jobCode: ctx.jobCode,
executionId: ctx.executionId
});
// Access job metadata
const metadata = ctx.getMetadata();
console.log('Job metadata:', metadata);
return 'Job completed';
}
);
Best Practices
-
Basic Status Tracking
async (ctx) => {
try {
await operation();
return 'Operation completed successfully';
} catch (error) {
throw error;
}
}
-
Execution Context
async (ctx) => {
console.log('Starting job:', {
jobCode: ctx.jobCode,
executionId: ctx.executionId
});
await processData();
return 'Job completed';
}
Job Execution Details
For each job execution, you can view detailed execution information:
The execution details show:
- Execution status (Completed/Failed)
- Scheduled and actual execution times
- Duration
- Standard output from the job
- Any error output if applicable
Next Steps