-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
【需求】实现 "定时任务" 模组 #40
Comments
初步调研了一下, 准备用 golang 的 cron 实现 |
再仔细调研了一下, 目前有2个库可供选择 一个是gocron 其中cron的语法格式贴近linux中的crontab语法, 而gocron支持链式调用, 使用上类似gorm 准备还是用gocron试试 |
开始进行表单设计, 初步规划做2个页面 找到了一个与我想法类似的开源项目 可以参考一下他的model文件里面, 对于表单的设计 |
尝试使用gocron的途中遇到了以下问题:
但是, 如果我想要移除某个特定的任务, 却需要知道这个任务的ID, 或者任务函数(我预期我的场景是会出现重复函数的) 这就会导致我在现实取消功能的时候非常麻烦 但是cron库这一块就做的比较好了 切换到cron继续尝试 |
cron这个库也有缺陷 |
背景:
最近在某个项目里面, 有这样一个场景: 我们需要随机地,定时地,删除某个文件夹下的一些文件, 以此验证一个自动备份的功能
实现这个随机删除的功能很简单, 但是这个定时执行的功能很尴尬, 最终是用crontab去实现的.
有必要针对这一块拓展一下我的工具盒的功能了
The text was updated successfully, but these errors were encountered: