{"id":13413229,"url":"https://github.com/deepaksinghvi/cdule","last_synced_at":"2026-01-12T13:34:38.184Z","repository":{"id":40576891,"uuid":"458506799","full_name":"deepaksinghvi/cdule","owner":"deepaksinghvi","description":"cdule (pronounce as Schedule) Golang based scheduler library with database support.","archived":false,"fork":false,"pushed_at":"2025-08-20T09:38:16.000Z","size":396,"stargazers_count":56,"open_issues_count":4,"forks_count":12,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-20T11:30:06.984Z","etag":null,"topics":["golang-scheduler","quartz","quartz-go","quartz-golang","quartz-scheduler","scheduler"],"latest_commit_sha":null,"homepage":"","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/deepaksinghvi.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-02-12T11:49:51.000Z","updated_at":"2025-08-20T09:38:20.000Z","dependencies_parsed_at":"2025-08-20T11:18:34.335Z","dependency_job_id":"0e0dd660-5277-4cb0-8614-214510f18057","html_url":"https://github.com/deepaksinghvi/cdule","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/deepaksinghvi/cdule","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepaksinghvi%2Fcdule","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepaksinghvi%2Fcdule/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepaksinghvi%2Fcdule/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepaksinghvi%2Fcdule/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepaksinghvi","download_url":"https://codeload.github.com/deepaksinghvi/cdule/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepaksinghvi%2Fcdule/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28339228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["golang-scheduler","quartz","quartz-go","quartz-golang","quartz-scheduler","scheduler"],"created_at":"2024-07-30T20:01:35.662Z","updated_at":"2026-01-12T13:34:38.120Z","avatar_url":"https://github.com/deepaksinghvi.png","language":"Go","funding_links":[],"categories":["Job Scheduler","作业调度器"],"sub_categories":["Search and Analytic Databases","检索及分析资料库","Advanced Console UIs"],"readme":"# cdule (pronounce as Schedule)\n![dbschema.png](pkg/doc/cdulelogo.png)\n\nGolang based scheduler library with database support.\nUsers could use any database which is supported by [gorm.io](https://gorm.io/).\n\n### To Download the cdule library\n```shell\ngo get github.com/deepaksinghvi/cdule\n```\n\n### Usage Instruction\n\nIn order to schedule jobs with cdule, user needs to\n1. Configure persistence\n2. Implement cdule.Job Interface \u0026\n3. Schedule job with required cron expression.\n\nJob will be persisted in the jobs table.\\\nNext execution would be persisted in schedules tables.\\\nJob history would be persisted and maintained in job_histories table.\n\n\n## Configuration\n\nUser needs to create a resources/config.yml in their project home directory with the followling keys\n\n* cduletype\n* dburl\n* cduleconsistency\n\ncduletype is used to specify whether it is an In-Memory or Database based configuration. Possible values are DATABASE and MEMORY.\ndburl is the database connection url.\ncduleconsistency is for reserved for future usage.\n\n### config.yml for postgressql based configuration\n```yaml\ncduletype: DATABASE\ndburl: postgres://cduleuser:cdulepassword@localhost:5432/cdule?sslmode=disable\ncduleconsistency: AT_MOST_ONCE\n```\n\n### config.yml for sqlite based in-memory configuration\n```yaml\ncduletype: MEMORY\ndburl: /Users/dsinghvi/sqlite.db\ncduleconsistency: AT_MOST_ONCE\n```\n\n\n## Job Interface Implementation\n\n```go\nvar testJobData map[string]string\n\ntype TestJob struct {\n\tJob cdule.Job\n}\n\nfunc (m TestJob) Execute(jobData map[string]string) {\n\tlog.Info(\"In TestJob\")\n\tfor k, v := range jobData {\n\t\tvalNum, err := strconv.Atoi(v)\n\t\tif nil == err {\n\t\t\tjobData[k] = strconv.Itoa(valNum + 1)\n\t\t} else {\n\t\t\tlog.Error(err)\n\t\t}\n\n\t}\n\ttestJobData = jobData\n}\n\nfunc (m TestJob) JobName() string {\n\treturn \"job.TestJob\"\n}\n\nfunc (m TestJob) GetJobData() map[string]string {\n\treturn testJobData\n}\n```\n\n## Schedule a Job\nIt is expected that testJob will be Executed five times, once for every minute and program will exit. TestJob jobData map holds the data in the format of map[string]string where gets stored for every execution and gets updated as the next counter value on Execute() method call.\n\n```go\ncdule := cdule.Cdule{}\ncdule.NewCdule()\ntestJob := TestJob{}\njobData := make(map[string]string)\njobData[\"one\"] = \"1\"\njobData[\"two\"] = \"2\"\njobData[\"three\"] = \"3\"\ncdule.NewJob(\u0026testJob, jobData).Build(utils.EveryMinute)\n\ntime.Sleep(5 * time.Minute)\ncdule.StopWatcher()\n```\n\n\n### Demo Project\nThis demo describes how cdule library can be used.\n\nhttps://github.com/deepaksinghvi/cduledemo\n\n\n### Database Schema\nFor the sample app, postgresql is used but users can use any db which is supported by gorm.io.\n#### DB Tables\n* jobs : To store unique jobs.\n* job_histories : To store job history with status as result.\n* schedules : To store schedule for every next run.\n* workers : To store the worker nodes and their health check.\n\n\n![dbschema.png](pkg/doc/dbschema.png)\n\n\n### Sample Cron\nUsers can use the pre-defined crons or use their own which are the [standard cron](https://en.wikipedia.org/wiki/Cron) expression\n```go\nEveryMinute              = \"0 * * ? * *\"\nEveryEvenMinute          = \"0 */2 * ? * *\"\nEveryUnEvenMinute        = \"0 1/2 * ? * *\"\nEveryTwoMinutes          = \"0 */2 * ? * *\"\nEveryHourAtMin153045     = \"0 15,30,45 * ? * *\"\nEveryHour                = \"0 0 * ? * *\"\nEveryEvenHour            = \"0 0 0/2 ? * *\"\nEveryUnEvenHour          = \"0 0 1/2 ? * *\"\nEveryThreeHours          = \"0 0 */3 ? * *\"\nEveryTwelveHours         = \"0 0 */12 ? * *\"\nEveryDayAtMidNight       = \"0 0 0 * * ?\"\nEveryDayAtOneAM          = \"0 0 1 * * ?\"\nEveryDayAtSixAM          = \"0 0 6 * * ?\"\nEverySundayAtNoon        = \"0 0 12 ? * \"\nEveryMondayAtNoon        = \"0 0 12 ? *\"\nEveryWeekDayAtNoon       = \"0 0 12 ? * MON-FRI\"\nEveryWeekEndAtNoon       = \"0 0 12 ? * SUN,SAT\"\nEveryMonthOnFirstAtNoon  = \"0 0 12 1 * ?\"\nEveryMonthOnSecondAtNoon = \"0 0 12 2 * ?\"\n```\n\n\n### This library is built using\n\n* Cron parser using the library [robfig/cron](https://github.com/robfig/cron)\n* ORM usign the library [gorm.io](https://gorm.io/)\n\n### Other Reports\npkg.go.dev: https://pkg.go.dev/github.com/deepaksinghvi/cdule\n\ngoreportcard.com: https://goreportcard.com/report/github.com/deepaksinghvi/cdule\n\ncoverage service link: https://app.codecov.io/gh/deepaksinghvi/cdule\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepaksinghvi%2Fcdule","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepaksinghvi%2Fcdule","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepaksinghvi%2Fcdule/lists"}