Skip to content

github.com/robfig/cron 测试动态添加带参数定时任务

License

Notifications You must be signed in to change notification settings

leafney/cron-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang实现动态添加带参数定时任务-Demo

详细说明请查看文章:

依赖

go get github.com/jakecoffman/cron

需求

在特定时刻启动定时任务,从数据库中获取待添加的任务信息,动态添加任务并执行,并在特定时刻停止这些动态任务。

  • 动态添加任务
  • 带参数任务方法

测试结果

11:19 启动定时任务,并在 11:20 停止定时任务

动态添加的任务 1 每 5s 执行一次;任务 2 每 7s 执行一次

About

github.com/robfig/cron 测试动态添加带参数定时任务

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages