Skip to content

Commit

Permalink
refactor(dbm-services): 优化db-resource启动 #9528
Browse files Browse the repository at this point in the history
  • Loading branch information
ymakedaq authored and iSecloud committed Mar 3, 2025
1 parent 1c2fb43 commit ebf663f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions dbm-services/common/db-resource/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ func main() {
ctx.SecureJSON(http.StatusOK, map[string]interface{}{"buildstamp": buildstamp, "githash": githash,
"version": version})
})
lcron := cron.New()
registerCrontab(lcron)
lcron.Start()
defer lcron.Stop()

srv := &http.Server{
Addr: config.GAppConfig.ListenAddr,
Expand All @@ -79,6 +75,12 @@ func main() {
logger.Fatal("listen: %s\n", err)
}
}()

lcron := cron.New()
registerCrontab(lcron)
lcron.Start()
defer lcron.Stop()

// Wait for interrupt signal to gracefully shutdown the server with
// a timeout of 5 seconds.
quit := make(chan os.Signal, 1)
Expand Down

0 comments on commit ebf663f

Please sign in to comment.