{"id":24617914,"url":"https://github.com/jacoblincool/cloudflare-worker-scheduler","last_synced_at":"2025-10-30T17:40:47.204Z","repository":{"id":41089325,"uuid":"508258957","full_name":"JacobLinCool/Cloudflare-Worker-Scheduler","owner":"JacobLinCool","description":"More cron jobs on Cloudflare Workers? No problem! A dashboard with password protected is also included!","archived":false,"fork":false,"pushed_at":"2023-12-15T17:41:23.000Z","size":111,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-24T23:41:30.929Z","etag":null,"topics":["cloudflare-workers","cron"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JacobLinCool.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-28T10:48:17.000Z","updated_at":"2024-06-03T23:54:19.000Z","dependencies_parsed_at":"2022-09-15T18:23:06.584Z","dependency_job_id":null,"html_url":"https://github.com/JacobLinCool/Cloudflare-Worker-Scheduler","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":"JacobLinCool/Cloudflare-Module-Worker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2FCloudflare-Worker-Scheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2FCloudflare-Worker-Scheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2FCloudflare-Worker-Scheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2FCloudflare-Worker-Scheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JacobLinCool","download_url":"https://codeload.github.com/JacobLinCool/Cloudflare-Worker-Scheduler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244308991,"owners_count":20432297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudflare-workers","cron"],"created_at":"2025-01-24T23:41:39.834Z","updated_at":"2025-10-30T17:40:42.182Z","avatar_url":"https://github.com/JacobLinCool.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloudflare Worker Scheduler\n\nMore cron jobs on Cloudflare Workers? No problem! A dashboard is also included!\n\n## How to use\n\n1. Fork the repository.\n2. Edit `src/tasks.ts`.\n\n```ts\nexport const tasks: Task[] = [\n    [\n        \"my-task-1\",\n        \"0/5 * * * *\",\n        async function (cron: Cron): Promise\u003c[boolean, string]\u003e {\n            const value = Math.random();\n            const success = value \u003e 0.5;\n            return [success, `The value is ${value}.`];\n        },\n    ],\n    [\n        \"ping Google\",\n        \"@minutely\",\n        async function (cron: Cron): Promise\u003c[boolean, string]\u003e {\n            const start = Date.now();\n            const res = await fetch(\"https://www.google.com\");\n            const end = Date.now();\n\n            return [res.ok, `${res.status} (${end - start}ms)`];\n        },\n    ],\n];\n```\n\n3. Publish to Cloudflare Worker.\n4. Setup the environment variables.\n\n### Environment Variables\n\n- `PAT`: Required. The GitHub Personal Access Token with the `gist` scope, which is used to update private gist as logfile.\n- `KEY`: Optional. The password to protect your dashboard and other API.\n\n## Endpoints\n\nThere are some endpoints for you to checkout the log and manually trigger the task.\n\n### `/`\n\nWeb Interface Dashboard.\n\n### `/list?key=YOUR_KEY`\n\nList all tasks with their cron settings.\n\n### `/log?key=YOUR_KEY`\n\nCheckout the log of the last `LOG_MAX_LENGTH` executed tasks.\n\n\u003e `LOG_MAX_LENGTH` is set to `100` by default and can be changed in `src/constants.ts`.\n\n### `/trigger?key=YOUR_KEY\u0026task=TASK_NAME`\n\nManually trigger a task.\n\n\u003e The result will not be logged because this method will respond with the result of the task directly.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacoblincool%2Fcloudflare-worker-scheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacoblincool%2Fcloudflare-worker-scheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacoblincool%2Fcloudflare-worker-scheduler/lists"}