百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
G

gocron

> 编程语言
开源

一个 Golang 作业调度包。

3.5K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个 Golang 作业调度包。

Note from current maintainers:

A currently maintained fork of this project has been migrated to https://github.com/go-co-op/gocron

Disclaimer: we (the maintainers) tried, with no luck, to get in contact with Jason (the repository owner) in order to add new maintainers or leave the project within an organization. Unfortunately, he hasn't replied for months now (March, 2020).

So, we decided to move the project to a new repository (as stated above), in order to keep the evolution of the project coming from as many people as possible. Feel free to reach over!

goCron: A Golang Job Scheduling Package.

This package is currently looking for new maintainers (cause @jasonlvhit is in ICU). Please message @jasonlvhit if you are interested. goCron is a Golang job scheduling package which lets you run Go functions periodically at pre-determined interval using a simple, human-friendly syntax.

goCron is a Golang implementation of Ruby module clockwork and Python job scheduling package schedule, and personally, this package is my first Golang program, just for fun and practice.

See also this two great articles:

  • Rethinking Cron
  • Replace Cron with Clockwork

If you want to chat, you can find us at Slack!

Back to this package, you could just use this simple API as below, to run a cron scheduler.

…

and full test cases and document will be coming soon (help is wanted! If you want to contribute, pull requests are welcome).

If you need to prevent a job from running at the same time from multiple cron instances (like running a cron app from multiple servers), you can provide a Locker implementation and lock the required jobs.

gocron.SetLocker(lockerImplementation)
gocron.Every(1).Hour().Lock().Do(task)

Once again, thanks to the great works of Ruby clockwork and Python schedule package. BSD license is used, see the file License for detail.

Looking to contribute? Try to follow these guidelines:

  • Use issues for everything
  • For a small change, just send a PR!
  • For bigger changes, please open an issue for discussion before sending a PR.
  • PRs should have: tests, documentation and examples (if it makes sense)
  • You can also contribute by:
    • Reporting issues
    • Suggesting new features or enhancements
    • Improving/fixing documentation

Have fun!

GitHub Issues· 46 开放

在 GitHub 查看全部
  • #178

    diff time in work machine?

    更新于 2025年4月21日
  • #175

    Dockerfile with gocron

    更新于 2023年3月30日
  • #174

    .Do overrides existing cron tasks

    更新于 2021年11月29日
  • #172

    How to make stop Scheduler?

    更新于 2021年8月25日
  • #170

    About task execution time

    更新于 2021年6月21日
  • #169

    exec time

    更新于 2021年6月9日
  • #160

    Lock function, still run multiple times on multiple server instances

    更新于 2021年6月3日
  • #41

    Support for standard Cron like definitions

    更新于 2021年4月24日
  • #19

    Cron job exited after undefined amount of time

    更新于 2021年4月1日
  • #106

    Hey, how do I set the last day of the month to be executed on time?

    更新于 2021年3月14日

核心特点

  • •Rethinking Cron
  • •Replace Cron with Clockwork
  • •Use issues for everything
  • •For a small change, just send a PR!
  • •For bigger changes, please open an issue for discussion before sending a PR.
  • •PRs should have: tests, documentation and examples (if it makes sense)
  • •You can also contribute by:
  • •Reporting issues
  • •Suggesting new features or enhancements
  • •Improving/fixing documentation

> 标签

Go

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言