feat kafka
This commit is contained in:
19
internal/timer/timer.go
Normal file
19
internal/timer/timer.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package timer
|
||||
|
||||
import "github.com/robfig/cron/v3"
|
||||
|
||||
type Timer struct {
|
||||
c *cron.Cron
|
||||
}
|
||||
|
||||
func (t *Timer) Start() {
|
||||
t.c = cron.New()
|
||||
_, _ = t.c.AddFunc("0/5 * * * ?", func() {
|
||||
})
|
||||
t.c.Start()
|
||||
go startConsumer()
|
||||
}
|
||||
|
||||
func (t *Timer) Stop() {
|
||||
t.c.Stop()
|
||||
}
|
||||
Reference in New Issue
Block a user