Overview

Scheduling

Operational scheduling, planned jobs, and temporal orchestration.

Screenshot Reference (User Manual)

  • manual__scheduling__01.png: scheduled task list with intervals, action type, and last/next execution status.

Scheduled Task Management

The Scheduler module executes planned jobs by reading the configuration from the dbo.scheduler metadata table and tracking outcomes in dbo.scheduler_execution.

Description:

the service periodically checks due tasks, executes the command, and updates execution states.

Runtime flow:

  • periodic backend poll (Hosted Service) on tasks with enabled = 1 and next_execution <= now.
  • task execution based on the configured action type.
  • outcome recording (ok/error, duration, message) to scheduler_execution.
  • update of last_execution, next_execution, last_ex_succeded fields.

scheduler Table Metadata (Main Fields)

  • id: task identifier.
  • enabled: enables/disables the job.
  • event_name: logical name of the scheduled event.
  • month_interval, day_interval, hour_interval, minute_interval, second_interval: combinable intervals used to calculate the next execution.
  • action_type: operation type executed by the job.
  • action_cmd: command associated with the action type.
  • last_execution: last execution timestamp.
  • next_execution: next planned execution timestamp.
  • last_ex_succeded: last outcome flag (true/false).

Action Types (action_type) and Meaning

Snippet (quick map):

  • 1 | sql -> SQL / stored procedure
  • 2 -> web service
  • 3 -> .NET method (Namespace.Type.Method)
  • 4 -> mailing/distribution list
  • 1 or sql: executes SQL/stored procedure.
  • 2: invokes a web service endpoint.
  • 3: invokes a .NET method (Namespace.Type.Method) via reflection.
  • 4: executes a mailing/distribution list action.

Execution Tracking (scheduler_execution)

For each run, at least the following is recorded:

  • reference to the scheduled task.
  • start and end date/time.
  • final status.
  • optional error message or summary output.

This enables operational auditing and job troubleshooting.

Relevant AppSettings

Description:

these keys govern the polling cycle, per-cycle concurrency, and SQL timeouts.

Snippet:

  • "Scheduler.Enabled": true
  • "Scheduler.PollSeconds": 15
  • "Scheduler.MaxTasksPerCycle": 20
  • "Scheduler.RetryDelaySeconds": 60
  • "Scheduler.SqlCommandTimeoutSeconds": 300
  • Enabled: enables/disables the backend scheduler.
  • PollSeconds: polling frequency for due tasks.
  • MaxTasksPerCycle: maximum number of tasks processed per cycle.
  • RetryDelaySeconds: minimum delay before retry after error.
  • SqlCommandTimeoutSeconds: timeout for scheduler SQL commands.

Result:

  • predictable and controllable scheduling per environment;
  • simple tuning of frequency, throughput, and error robustness.

Screenshot

scheduling / main
scheduling / main