No description
  • Go 99.1%
  • Dockerfile 0.5%
  • Makefile 0.4%
Find a file
zemdregon f21d20e06f
Some checks are pending
CI / lint (push) Waiting to run
CI / test (push) Waiting to run
CI / build (push) Waiting to run
CI / docker (push) Blocked by required conditions
chore(deps): bump actions/setup-go to v7 (#23)
* chore(deps): bump actions/setup-go to v7

Self-hosted CI workflows.

* ci: setup-go v7 + cache false
2026-08-10 19:38:04 -05:00
.github chore(deps): bump actions/setup-go to v7 (#23) 2026-08-10 19:38:04 -05:00
cmd/module feat: cronstore/server hardening and template/CI alignment 2026-07-22 19:10:04 -05:00
deploy feat: cronstore/server hardening and template/CI alignment 2026-07-22 19:10:04 -05:00
internal Add SettingsProvider for timezone/store/catch-up (v0.1.5). 2026-08-10 04:14:00 -05:00
test Add muxcored integration test for register, discover, and @once fire. 2026-08-09 21:31:19 -05:00
.dockerignore refactor: align with muxcore-module-starter template 2026-06-12 11:50:01 -05:00
.env.example Add SettingsProvider for timezone/store/catch-up (v0.1.5). 2026-08-10 04:14:00 -05:00
.gitignore feat: cronstore/server hardening and template/CI alignment 2026-07-22 19:10:04 -05:00
.golangci.yml refactor: align with muxcore-module-starter template 2026-06-12 11:50:01 -05:00
CHANGELOG.md Add SettingsProvider for timezone/store/catch-up (v0.1.5). 2026-08-10 04:14:00 -05:00
COMPATIBILITY.md chore: add LICENSE, SECURITY.md, CHANGELOG.md, CONTRIBUTING.md, COMPATIBILITY.md, .env.example, Makefile, .golangci.yml, Dockerfile, .dockerignore 2026-06-10 06:55:42 -05:00
CONTRIBUTING.md feat: cronstore/server hardening and template/CI alignment 2026-07-22 19:10:04 -05:00
Dockerfile chore(deps): bump golang from 1.24-alpine to 1.26-alpine 2026-06-12 16:51:08 +00:00
go.mod Add SettingsProvider for timezone/store/catch-up (v0.1.5). 2026-08-10 04:14:00 -05:00
go.sum Add SettingsProvider for timezone/store/catch-up (v0.1.5). 2026-08-10 04:14:00 -05:00
LICENSE chore: add LICENSE, SECURITY.md, CHANGELOG.md, CONTRIBUTING.md, COMPATIBILITY.md, .env.example, Makefile, .golangci.yml, Dockerfile, .dockerignore 2026-06-10 06:55:42 -05:00
Makefile chore: add LICENSE, SECURITY.md, CHANGELOG.md, CONTRIBUTING.md, COMPATIBILITY.md, .env.example, Makefile, .golangci.yml, Dockerfile, .dockerignore 2026-06-10 06:55:42 -05:00
muxcore.json Add SettingsProvider for timezone/store/catch-up (v0.1.5). 2026-08-10 04:14:00 -05:00
README.md docs: point operators at muxcorectl schedules commands 2026-08-10 10:35:43 -05:00
ROADMAP.md Add muxcored integration test for register, discover, and @once fire. 2026-08-09 21:31:19 -05:00
SECURITY.md chore: add LICENSE, SECURITY.md, CHANGELOG.md, CONTRIBUTING.md, COMPATIBILITY.md, .env.example, Makefile, .golangci.yml, Dockerfile, .dockerignore 2026-06-10 06:55:42 -05:00

Scheduler Cron

Cron-based task scheduler for periodic and recurring jobs in MuxCore.

Core has no built-in Scheduler — this module is the reference implementation (on the default spool). Without it, there is no way to run tasks on a schedule; all automation must be triggered manually or by external tooling.

How It Works

Client registers a cron task via HTTP:
  POST /schedule  { name, cron_expr, payload?, timeout?, meta? }
        │
        ▼
scheduler-cron validates the expression and stores the schedule in-memory
        │
        ▼
At the scheduled time, the cron store fires the task handler
(currently logs only; see ROADMAP for event publishing)

Supported Cron Expressions

Standard 5-field cron expressions:

┌───────── minute (0-59)
│ ┌───────── hour (0-23)
│ │ ┌───────── day of month (1-31)
│ │ │ ┌───────── month (1-12)
│ │ │ │ ┌───────── day of week (0-6, 0=Sunday)
* * * * *

Also supports:

  • @every 5m — run every 5 minutes
  • @daily — run at midnight
  • @hourly — run at the top of each hour

Configuration

Environment

Variable Default Description
SCHEDULER_HTTP_ADDR :9200 HTTP listen address for the schedule API
MUXCORE_GRPC_ADDR (SDK default) Core gRPC address for sidecar registration
MUXCORE_MODULE_ID scheduler-cron Module identity when registering with core
MUXCORE_INSECURE_DISABLE_TLS unset Dev-only: disable TLS to core

Timezone: set SCHEDULER_TZ (IANA name; default UTC). One-shot: "once": true or cron_expr: "@once". Task webhook timeout: "timeout": "30s". Events: scheduler.task.fired|completed|failed|timeout. Persistence: set SCHEDULER_STORE_PATH (JSON). Integration: go test -tags=integration ./test (needs MUXCORED_BIN or CORE_DIR / sibling ../core).

HTTP API

Method Path Description
POST /schedule Register a task (name, cron_expr required)
DELETE /cancel/{id} Cancel a task
GET /status/{id} Get task status
GET /list List tasks (?name= substring filter)
GET /health Health check
GET /metrics Prometheus gauge scheduler_tasks_total

Implementation

  • Registers with capabilities: "scheduler", "scheduler.cron"
  • HTTP API mirrors contracts.Scheduler operations (Schedule, Cancel, Status, List)
  • Uses robfig/cron/v3 for cron expression parsing (including descriptors)
  • Tasks are stored in-memory
  • Default HTTP listen address: :9200

Operator surface: muxcorectl-cli schedules list|status|add|cancel (discovers this modules HttpAddr, or set --scheduler-url / SCHEDULER_URL).