mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-23 05:08:13 -05:00
26 lines
357 B
Go
26 lines
357 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/robfig/cron/v3"
|
|
)
|
|
|
|
func main() {
|
|
c := cron.New(cron.WithSeconds())
|
|
_, err := c.AddFunc("* * * * * *", func() {
|
|
log.Println("bingo second")
|
|
})
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
_, err = c.AddFunc("* * * * *", func() {
|
|
log.Println("bingo minute")
|
|
})
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
c.Start()
|
|
select {}
|
|
}
|