mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-06 05:30:05 +00:00
⚡️ pprof 性能调优 / 计划任务支持秒级
This commit is contained in:
@@ -1,7 +1,25 @@
|
||||
package main
|
||||
|
||||
import "github.com/naiba/nezha/cmd/agent/pty"
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/robfig/cron/v3"
|
||||
)
|
||||
|
||||
func main() {
|
||||
pty.DownloadDependency()
|
||||
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 {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user