{"id":13436753,"url":"https://github.com/robfig/cron","last_synced_at":"2025-09-09T20:48:55.225Z","repository":{"id":3842410,"uuid":"4925652","full_name":"robfig/cron","owner":"robfig","description":"a cron library for go","archived":false,"fork":false,"pushed_at":"2024-07-08T01:21:14.000Z","size":180,"stargazers_count":13806,"open_issues_count":162,"forks_count":1673,"subscribers_count":203,"default_branch":"master","last_synced_at":"2025-09-01T22:59:43.540Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/robfig.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}},"created_at":"2012-07-06T14:06:34.000Z","updated_at":"2025-09-01T21:57:11.000Z","dependencies_parsed_at":"2023-01-13T12:46:51.658Z","dependency_job_id":"f4078936-d240-47d6-98d1-226a786121cc","html_url":"https://github.com/robfig/cron","commit_stats":{"total_commits":113,"total_committers":37,"mean_commits":3.054054054054054,"dds":0.7079646017699115,"last_synced_commit":"bc59245fe10efaed9d51b56900192527ed733435"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/robfig/cron","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robfig%2Fcron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robfig%2Fcron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robfig%2Fcron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robfig%2Fcron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robfig","download_url":"https://codeload.github.com/robfig/cron/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robfig%2Fcron/sbom","scorecard":{"id":780528,"data":{"date":"2025-08-11","repo":{"name":"github.com/robfig/cron","commit":"bc59245fe10efaed9d51b56900192527ed733435"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"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":"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":"Code-Review","score":3,"reason":"Found 8/26 approved changesets -- score normalized to 3","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":"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":"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":"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":"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":"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 'master'"],"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 12 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-23T04:47:58.924Z","repository_id":3842410,"created_at":"2025-08-23T04:47:58.924Z","updated_at":"2025-08-23T04:47:58.924Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274359223,"owners_count":25270719,"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","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-07-31T03:00:51.868Z","updated_at":"2025-09-09T20:48:55.181Z","avatar_url":"https://github.com/robfig.png","language":"Go","readme":"[![GoDoc](http://godoc.org/github.com/robfig/cron?status.png)](http://godoc.org/github.com/robfig/cron)\n[![Build Status](https://travis-ci.org/robfig/cron.svg?branch=master)](https://travis-ci.org/robfig/cron)\n\n# cron\n\nCron V3 has been released!\n\nTo download the specific tagged release, run:\n```bash\ngo get github.com/robfig/cron/v3@v3.0.0\n```\nImport it in your program as:\n```go\nimport \"github.com/robfig/cron/v3\"\n```\nIt requires Go 1.11 or later due to usage of Go Modules.\n\nRefer to the documentation here:\nhttp://godoc.org/github.com/robfig/cron\n\nThe rest of this document describes the the advances in v3 and a list of\nbreaking changes for users that wish to upgrade from an earlier version.\n\n## Upgrading to v3 (June 2019)\n\ncron v3 is a major upgrade to the library that addresses all outstanding bugs,\nfeature requests, and rough edges. It is based on a merge of master which\ncontains various fixes to issues found over the years and the v2 branch which\ncontains some backwards-incompatible features like the ability to remove cron\njobs. In addition, v3 adds support for Go Modules, cleans up rough edges like\nthe timezone support, and fixes a number of bugs.\n\nNew features:\n\n- Support for Go modules. Callers must now import this library as\n  `github.com/robfig/cron/v3`, instead of `gopkg.in/...`\n\n- Fixed bugs:\n  - 0f01e6b parser: fix combining of Dow and Dom (#70)\n  - dbf3220 adjust times when rolling the clock forward to handle non-existent midnight (#157)\n  - eeecf15 spec_test.go: ensure an error is returned on 0 increment (#144)\n  - 70971dc cron.Entries(): update request for snapshot to include a reply channel (#97)\n  - 1cba5e6 cron: fix: removing a job causes the next scheduled job to run too late (#206)\n\n- Standard cron spec parsing by default (first field is \"minute\"), with an easy\n  way to opt into the seconds field (quartz-compatible). Although, note that the\n  year field (optional in Quartz) is not supported.\n\n- Extensible, key/value logging via an interface that complies with\n  the https://github.com/go-logr/logr project.\n\n- The new Chain \u0026 JobWrapper types allow you to install \"interceptors\" to add\n  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\nIt is backwards incompatible with both v1 and v2. These updates are required:\n\n- The v1 branch accepted an optional seconds field at the beginning of the cron\n  spec. This is non-standard and has led to a lot of confusion. The new default\n  parser conforms to the standard as described by [the Cron wikipedia page].\n\n  UPDATING: To retain the old behavior, construct your Cron with a custom\n  parser:\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- The Cron type now accepts functional options on construction rather than the\n  previous ad-hoc behavior modification mechanisms (setting a field, calling a setter).\n\n  UPDATING: Code that sets Cron.ErrorLogger or calls Cron.SetLocation must be\n  updated to provide those values on construction.\n\n- CRON_TZ is now the recommended way to specify the timezone of a single\n  schedule, which is sanctioned by the specification. The legacy \"TZ=\" prefix\n  will continue to be supported since it is unambiguous and easy to do so.\n\n  UPDATING: No update is required.\n\n- By default, cron will no longer recover panics in jobs that it runs.\n  Recovering can be surprising (see issue #192) and seems to be at odds with\n  typical behavior of libraries. Relatedly, the `cron.WithPanicLogger` option\n  has been removed to accommodate the more general JobWrapper type.\n\n  UPDATING: To opt into panic recovery and configure the panic logger:\n```go\ncron.New(cron.WithChain(\n  cron.Recover(logger),  // or use cron.DefaultLogger\n))\n```\n- In adding support for https://github.com/go-logr/logr, `cron.WithVerboseLogger` was\n  removed, since it is duplicative with the leveled logging.\n\n  UPDATING: Callers should use `WithLogger` and specify a logger that does not\n  discard `Info` logs. For convenience, one is provided that wraps `*log.Logger`:\n```go\ncron.New(\n  cron.WithLogger(cron.VerbosePrintfLogger(logger)))\n```\n\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.\n","funding_links":[],"categories":["HarmonyOS","Misc","Go","开源类库","Open source library","后端开发框架及项目"],"sub_categories":["Windows Manager","任务/定时器","Task/Timer","后端项目_其他"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobfig%2Fcron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobfig%2Fcron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobfig%2Fcron/lists"}