{"id":34117176,"url":"https://github.com/hanagantig/cron","last_synced_at":"2026-03-09T23:01:41.403Z","repository":{"id":45080377,"uuid":"376274920","full_name":"hanagantig/cron","owner":"hanagantig","description":"Cron library for go with distributed lock","archived":false,"fork":false,"pushed_at":"2022-01-10T11:18:36.000Z","size":80,"stargazers_count":50,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-17T05:19:31.134Z","etag":null,"topics":["cron","distributed-lock","go","go-cron","go-crontab","go-tools","golang","microservice","redis-lock","schedule","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/hanagantig.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":"2021-06-12T11:36:42.000Z","updated_at":"2024-08-12T15:30:59.000Z","dependencies_parsed_at":"2022-08-29T23:24:16.926Z","dependency_job_id":null,"html_url":"https://github.com/hanagantig/cron","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/hanagantig/cron","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanagantig%2Fcron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanagantig%2Fcron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanagantig%2Fcron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanagantig%2Fcron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hanagantig","download_url":"https://codeload.github.com/hanagantig/cron/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanagantig%2Fcron/sbom","scorecard":{"id":454106,"data":{"date":"2025-08-11","repo":{"name":"github.com/hanagantig/cron","commit":"58d35c7d2a72b2412379863fd6d2286ac51591d9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/16 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T09:07:20.985Z","repository_id":45080377,"created_at":"2025-08-19T09:07:20.985Z","updated_at":"2025-08-19T09:07:20.985Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30315951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T20:05:46.299Z","status":"ssl_error","status_checked_at":"2026-03-09T19:57:04.425Z","response_time":61,"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":["cron","distributed-lock","go","go-cron","go-crontab","go-tools","golang","microservice","redis-lock","schedule","scheduler"],"created_at":"2025-12-14T20:27:38.908Z","updated_at":"2026-03-09T23:01:41.395Z","avatar_url":"https://github.com/hanagantig.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GoDoc](http://godoc.org/github.com/hanagantig/cron?status.png)](http://godoc.org/github.com/hanagantig/cron)\n[![Build Status](https://travis-ci.org/hanagantig/cron.svg?branch=main)](https://travis-ci.com/hanagantig/cron)\n\n# cron\n\n*Essentially it's a fork of [robfig cron](https://github.com/robfig/cron) with **distributed lock** feature.*\n\n**This cron package is helpful when you scale your cron instances and want to run same jobs once at a time**.\n\nThere is built-in implementation with redsync distributed lock\n([Redis-based distributed mutual exclusion lock](https://github.com/go-redsync/redsync)).\n\u003e :warning: *Be careful and make sure to understand how the redlock algorithm works. Check [this discussion](http://antirez.com/news/101).*\n\nMoreover, you are capable to provide your own locker implementation.\nCheck the [feature example](#job-distributed-lock). \n\n## Getting started\nTo download the package, run:\n```bash\ngo get github.com/hanagantig/cron\n```\n\nImport it in your program as:\n```go\nimport \"github.com/hanagantig/cron\"\n```\n\nA simple usage:\n```go\nmyCron := cron.New(cron.WithLogger(logger), cron.WithRedsyncLocker(redisPool))\nmyCron.AddFunc(\"*/15 * * * *\", \"myTaskKey\", myTaskFunc)\nmyCron.Start()\n```\n\nRefer to the documentation here: http://godoc.org/github.com/hanagantig/cron\n\n## Features\n### Spec parsers\nStandard cron spec parsing by default (first field is \"minute\"), with an easy way to opt into the seconds field (quartz-compatible). Although, note that the year field (optional in Quartz) is not supported.\n```go\n// Seconds field, required\ncron.New(cron.WithSeconds())\n\n// Seconds field, optional\ncron.New(cron.WithParser(cron.NewParser(\n\tcron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor,\n)))\n```\n### Logging\nExtensible, key/value logging via an interface that complies with the https://github.com/go-logr/logr project.\nConfigure a logger:\n```go\ncron.New(\n    cron.WithLogger(cron.VerbosePrintfLogger(logger))\n)\n```\n\n### Interceptors\nChain \u0026 JobWrapper types allow you to install \"interceptors\" to add cross-cutting behavior like the following:\n  - Recover any panics from jobs\n  - Delay a job's execution if the previous run hasn't completed yet\n  - Skip a job's execution if the previous run hasn't completed yet\n  - Log each job's invocations\n  - Notification when jobs are completed\n  - Panic recovery and configure the panic logger\n```go\ncron.New(cron.WithChain(\n  cron.Recover(logger),  // or use cron.DefaultLogger\n))\n```\n### Job distributed lock\nYou can use built-in redsync locker to lock your jobs or provide a custom locker.\n```go\n// with built-in redsync locker\ncron.New(\n    cron.WithRedsyncLocker(pool)\n)\n\n// with your own locker\ncron.New(\n    cron.WithLocks(locker)\n)\n```\n\nCheck the [documentation](https://pkg.go.dev/github.com/hanagantig/cron#WithRedsyncLocker) for `WithRedsyncLocker` option.\n## Background - Cron spec format\n\nThere are two cron spec formats in common usage:\n\n- The \"standard\" cron format, described on [the Cron wikipedia page] and used by\n  the cron Linux system utility.\n\n- The cron format used by [the Quartz Scheduler], commonly used for scheduled\n  jobs in Java software\n\n[the Cron wikipedia page]: https://en.wikipedia.org/wiki/Cron\n[the Quartz Scheduler]: http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/tutorial-lesson-06.html\n\nThe original version of this package included an optional \"seconds\" field, which\nmade it incompatible with both of these formats. Now, the \"standard\" format is\nthe default format accepted, and the Quartz format is opt-in.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanagantig%2Fcron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhanagantig%2Fcron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanagantig%2Fcron/lists"}