Skip to content

Commit

Permalink
fix: cron not start after installed #74
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJacky committed Feb 13, 2023
1 parent a3dfc7a commit bf3edfa
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,20 @@ func prog(state overseer.State) {
log.Printf("Nginx config dir path: %s", nginx.GetConfPath())
if "" != settings.ServerSettings.JwtSecret {
model.Init()
}

s := gocron.NewScheduler(time.UTC)
job, err := s.Every(1).Hour().SingletonMode().Do(cert.AutoCert)
s := gocron.NewScheduler(time.UTC)
job, err := s.Every(1).Hour().SingletonMode().Do(cert.AutoCert)

if err != nil {
log.Fatalf("AutoCert Job: %v, Err: %v\n", job, err)
}
if err != nil {
log.Fatalf("AutoCert Job: %v, Err: %v\n", job, err)
}

s.StartAsync()
s.StartAsync()

go analytic.RecordServerAnalytic()
}
err := http.Serve(state.Listener, router.InitRouter())
go analytic.RecordServerAnalytic()

err = http.Serve(state.Listener, router.InitRouter())
if err != nil {
log.Fatalln(err)
}
Expand Down

0 comments on commit bf3edfa

Please # to comment.