feat(cron): add cron scheduler
This commit is contained in:
parent
0dfa09033e
commit
0962ddb57c
4 changed files with 32 additions and 12 deletions
19
src/cron/wrapper.go
Normal file
19
src/cron/wrapper.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package cron
|
||||
|
||||
import cronv3 "github.com/robfig/cron/v3"
|
||||
|
||||
type ICron interface {
|
||||
AddFun(spec string, cmd func()) error
|
||||
Start()
|
||||
Stop()
|
||||
}
|
||||
|
||||
type MyCron struct {
|
||||
*cronv3.Cron
|
||||
}
|
||||
|
||||
func NewMyCron() *MyCron {
|
||||
return &MyCron{
|
||||
Cron: cronv3.New(),
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue