{"id":13425038,"url":"https://github.com/cenkalti/dalga","last_synced_at":"2025-05-07T15:20:31.888Z","repository":{"id":52727319,"uuid":"13264934","full_name":"cenkalti/dalga","owner":"cenkalti","description":"⏰ MySQL backed Job Scheduler with a HTTP interface","archived":false,"fork":false,"pushed_at":"2021-04-20T02:40:19.000Z","size":1356,"stargazers_count":248,"open_issues_count":2,"forks_count":21,"subscribers_count":17,"default_branch":"v3","last_synced_at":"2025-05-06T05:14:12.394Z","etag":null,"topics":["go","job-scheduler"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/cenkalti/dalga/v3","language":"Go","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/cenkalti.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":"2013-10-02T07:20:06.000Z","updated_at":"2024-11-07T05:04:41.000Z","dependencies_parsed_at":"2022-08-30T08:51:38.041Z","dependency_job_id":null,"html_url":"https://github.com/cenkalti/dalga","commit_stats":null,"previous_names":["cenk-zzz/dalga","cenk/dalga"],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cenkalti%2Fdalga","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cenkalti%2Fdalga/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cenkalti%2Fdalga/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cenkalti%2Fdalga/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cenkalti","download_url":"https://codeload.github.com/cenkalti/dalga/tar.gz/refs/heads/v3","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252902673,"owners_count":21822274,"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":["go","job-scheduler"],"created_at":"2024-07-31T00:01:02.956Z","updated_at":"2025-05-07T15:20:31.867Z","avatar_url":"https://github.com/cenkalti.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"Dalga\n=====\n\nDalga is a job scheduler. It's like cron-as-a-service.\n\n- Can schedule periodic or one-off jobs.\n- Stores jobs in a MySQL table with location info.\n- Has an HTTP interface for scheduling and cancelling jobs.\n- Makes a POST request to the endpoint defined in config on the job's execution time.\n- Retries failed jobs with constant or exponential backoff.\n- Multiple instances can be run for high availability and scaling out.\n\nInstall\n-------\n\nUse pre-built Docker image:\n\n    $ docker run -e DALGA_MYSQL_HOST=mysql.example.com cenkalti/dalga\n\nor download the latest binary from [releases page](https://github.com/cenkalti/dalga/releases).\n\nUsage\n-----\n\nSee [example config file](https://github.com/cenkalti/dalga/blob/v3/config.toml) for configuration options.\nTOML and YAML file formats are supported.\nConfiguration values can also be set via environment variables with `DALGA_` prefix.\n\nFirst, you must create the table for storing jobs:\n\n    $ dalga -config dalga.toml -create-tables\n\nThen, run the server:\n\n    $ dalga -config dalga.toml\n\nSchedule a new job to run every 60 seconds:\n\n    $ curl -i -X PUT 'http://127.0.0.1:34006/jobs/check_feed/1234?interval=60'\n    HTTP/1.1 201 Created\n    Content-Type: application/json; charset=utf-8\n    Date: Tue, 11 Nov 2014 22:10:40 GMT\n    Content-Length: 83\n\n    {\"path\":\"check_feed\",\"body\":\"1234\",\"interval\":60,\"next_run\":\"2014-11-11T22:11:40Z\"}\n\nPUT always returns 201. If there is an existing job with path and body, it will be rescheduled.\n\nThere are 4 options that you can pass to `Schedule` but not every combination is valid:\n\n| Param     | Description                            | Type                         | Example                 |\n| -----     | -----------                            | ----                         | -------                 |\n| interval  | Run job at intervals                   | Integer or ISO 8601 interval | 60 or PT60S             |\n| first-run | Do not run job until this time         | RFC3339 Timestamp            | 1985-04-12T23:20:50.52Z |\n| one-off   | Run job only once                      | Boolean                      | true, false, 1, 0       |\n| immediate | Run job immediately as it is scheduled | Boolean                      | true, false, 1, 0       |\n\n60 seconds later, Dalga makes a POST to your endpoint defined in config:\n\n    Path: \u003cconfig.baseurl\u003e/\u003cjob.path\u003e\n    Body: \u003cjob.body\u003e\n\nThe endpoint must return 200 if the job is successful.\n\nThe endpoint may return 204 if job is invalid. In this case Dalga will remove the job from the table.\n\nAnything other than 200 or 204 makes Dalga to retry the job indefinitely with an exponential backoff.\n\nGet the status of a job:\n\n    $ curl -i -X GET 'http://127.0.0.1:34006/jobs/check_feed/1234'\n    HTTP/1.1 200 OK\n    Content-Type: application/json; charset=utf-8\n    Date: Tue, 11 Nov 2014 22:12:21 GMT\n    Content-Length: 83\n\n    {\"path\":\"check_feed\",\"body\":\"1234\",\"interval\":60,\"next_run\":\"2014-11-11T22:12:41Z\"}\n\nGET may return 404 if job is not found.\n\nCancel previously scheduled job:\n\n    $ curl -i -X DELETE 'http://127.0.0.1:34006/jobs/check_feed/1234'\n    HTTP/1.1 204 No Content\n    Date: Tue, 11 Nov 2014 22:13:35 GMT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcenkalti%2Fdalga","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcenkalti%2Fdalga","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcenkalti%2Fdalga/lists"}