feat kafka

This commit is contained in:
2026-01-23 21:26:08 +08:00
parent f80167df85
commit 6c124f9f3f
9 changed files with 201 additions and 21 deletions

19
internal/timer/timer.go Normal file
View 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()
}