CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-cron

Cron jobs for Node.js applications that enables developers to execute functions or system commands on schedules defined using standard cron syntax

94

1.20x
Overview
Eval results
Files

task.mdevals/scenario-3/

Job Execution Monitor

A monitoring utility that schedules periodic health checks for system services and tracks execution delays to ensure jobs run within acceptable time windows.

Capabilities

Schedules health checks with execution deadline tracking

Creates scheduled jobs that monitor whether executions are occurring within acceptable time bounds, particularly important for time-sensitive system monitoring tasks.

  • A job scheduled to run every 5 seconds with a 100ms execution threshold executes when delays are under 100ms @test
  • A job scheduled to run every 5 seconds with a 50ms execution threshold skips execution when system delays exceed 50ms @test
  • Multiple jobs with different threshold values (100ms, 200ms, 500ms) each respect their individual thresholds independently @test
  • A job with threshold set to 0 always executes regardless of delays @test

Implementation

@generates

API

/**
 * Creates a scheduled health check job with execution threshold control.
 *
 * @param {string} cronTime - Cron expression defining the schedule (e.g., "*/5 * * * * *")
 * @param {number} thresholdMs - Maximum acceptable delay in milliseconds before skipping execution
 * @param {Function} onTick - Callback function to execute on each scheduled tick
 * @param {Object} options - Additional configuration options
 * @param {boolean} options.start - Whether to start the job immediately (default: true)
 * @returns {Object} Job controller with start() and stop() methods
 */
function createHealthCheckJob(cronTime, thresholdMs, onTick, options = {}) {
  // IMPLEMENTATION HERE
}

module.exports = {
  createHealthCheckJob
};

Dependencies { .dependencies }

cron { .dependency }

Provides job scheduling with execution threshold control capabilities.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-cron

tile.json