Skip to content

Commit

Permalink
fix(onge): 🐛 fix panic for db connect failed
Browse files Browse the repository at this point in the history
  • Loading branch information
Aimerny committed Jul 29, 2024
1 parent 8fe15cb commit a673807
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ func initService(config *common.Config) {
// init onge service
if config.OngeEnable {
onge.InitOngeService(config)
if !onge.OngeStatus {
logrus.Warning("onge service status is not enable!")
return
}
err := onge.FetchMaiResources()
if err != nil {
logrus.WithError(err).Error("fetch mai resources failed...")
Expand All @@ -51,6 +55,10 @@ func initService(config *common.Config) {
}

func prepare(config *common.Config) {
if !onge.OngeStatus {
logrus.Info("onge service disable. skip")
return
}
// prepare data dir
_, err := os.ReadDir(config.DataDirPath)
if os.IsNotExist(err) {
Expand Down

0 comments on commit a673807

Please sign in to comment.