{"id":13413245,"url":"https://github.com/carlescere/scheduler","last_synced_at":"2026-01-10T11:07:30.614Z","repository":{"id":26795990,"uuid":"30254409","full_name":"carlescere/scheduler","owner":"carlescere","description":"Job scheduling made easy.","archived":false,"fork":false,"pushed_at":"2022-06-23T14:43:15.000Z","size":19,"stargazers_count":446,"open_issues_count":8,"forks_count":54,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-07-30T20:43:29.008Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"felipeg48/pro-spring-boot","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carlescere.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":"2015-02-03T17:10:23.000Z","updated_at":"2024-07-24T14:32:07.000Z","dependencies_parsed_at":"2022-08-16T05:40:08.883Z","dependency_job_id":null,"html_url":"https://github.com/carlescere/scheduler","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlescere%2Fscheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlescere%2Fscheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlescere%2Fscheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlescere%2Fscheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carlescere","download_url":"https://codeload.github.com/carlescere/scheduler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243635293,"owners_count":20322912,"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":[],"created_at":"2024-07-30T20:01:35.976Z","updated_at":"2025-03-14T19:31:41.538Z","avatar_url":"https://github.com/carlescere.png","language":"Go","funding_links":[],"categories":["Job Scheduler","Go","Utilities","Relational Databases","实用工具","作业调度器","工具库","實用工具","作业调度"],"sub_categories":["Search and Analytic Databases","Advanced Console UIs","高级控制台界面","检索及分析资料库","交流","高級控制台界面","SQL 查询语句构建库","HTTP Clients","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e"],"readme":"# scheduler\n[![GoDoc](https://godoc.org/github.com/carlescere/scheduler?status.svg)](https://godoc.org/github.com/carlescere/scheduler)\n[![Build Status](https://travis-ci.org/carlescere/scheduler.svg?branch=master)](https://travis-ci.org/carlescere/scheduler)\n[![Coverage Status](https://coveralls.io/repos/carlescere/scheduler/badge.svg?branch=master)](https://coveralls.io/r/carlescere/scheduler?branch=master)\n\nJob scheduling made easy.\n\nScheduler allows you to schedule recurrent jobs with an easy-to-read syntax.\n\nInspired by the article **[Rethinking Cron](http://adam.heroku.com/past/2010/4/13/rethinking_cron/)** and the **[schedule](https://github.com/dbader/schedule)** python module.\n\n## How to use?\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"runtime\"\n\t\"time\"\n\n\t\"github.com/carlescere/scheduler\"\n)\n\nfunc main() {\n\tjob := func() {\n\t\tt := time.Now()\n\t\tfmt.Println(\"Time's up! @\", t.UTC())\n\t}\n      // Run every 2 seconds but not now.\n\tscheduler.Every(2).Seconds().NotImmediately().Run(job)\n      \n      // Run now and every X.\n\tscheduler.Every(5).Minutes().Run(job)\n\tscheduler.Every().Day().Run(job)\n\tscheduler.Every().Monday().At(\"08:30\").Run(job)\n      \n      // Keep the program from not exiting.\n\truntime.Goexit()\n}\n```\n\n## How it works?\nBy specifying the chain of calls, a `Job` struct is instantiated and a goroutine is starts observing the `Job`.\n\nThe goroutine will be on pause until:\n* The next run scheduled is due. This will cause to execute the job.\n* The `SkipWait` channel is activated. This will cause to execute the job.\n* The `Quit` channel is activated. This will cause to finish the job.\n\n## Not immediate recurrent jobs\nBy default the behaviour of the recurrent jobs (Every(N) seconds, minutes, hours) is to start executing the job right away and then wait the required amount of time. By calling specifically `.NotImmediately()` you can override that behaviour and not execute it directly when the function `Run()` is called.\n\n```go\nscheduler.Every(5).Minutes().NotImmediately().Run(job)\n```\n\n## License\nDistributed under MIT license. See `LICENSE` for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlescere%2Fscheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarlescere%2Fscheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlescere%2Fscheduler/lists"}