Browse Source

增加服务启动打印,方便定位服务启动突然卡顿的问题。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.21.12.1^2
zouap 4 years ago
parent
commit
884c57ac18
4 changed files with 9 additions and 0 deletions
  1. +1
    -0
      modules/setting/indexer.go
  2. +1
    -0
      modules/setting/queue.go
  3. +1
    -0
      modules/setting/webhook.go
  4. +6
    -0
      routers/init.go

+ 1
- 0
modules/setting/indexer.go View File

@@ -83,6 +83,7 @@ func newIndexerService() {
Indexer.UpdateQueueLength = sec.Key("UPDATE_BUFFER_LEN").MustInt(20)
Indexer.MaxIndexerFileSize = sec.Key("MAX_FILE_SIZE").MustInt64(1024 * 1024)
Indexer.StartupTimeout = sec.Key("STARTUP_TIMEOUT").MustDuration(30 * time.Second)
log.Info("New IndexerService Inited.")
}

// IndexerGlobFromString parses a comma separated list of patterns and returns a glob.Glob slice suited for repo indexing


+ 1
- 0
modules/setting/queue.go View File

@@ -160,6 +160,7 @@ func NewQueueService() {
if _, ok := sectionMap["LENGTH"]; !ok {
_, _ = section.NewKey("LENGTH", fmt.Sprintf("%d", Repository.PullRequestQueueLength))
}
log.Info("New QueueService Inited.")
}

// ParseQueueConnStr parses a queue connection string


+ 1
- 0
modules/setting/webhook.go View File

@@ -48,4 +48,5 @@ func newWebhookService() {
}
}
Webhook.ProxyHosts = sec.Key("PROXY_HOSTS").Strings(",")
log.Info("New WebhookService Inited.")
}

+ 6
- 0
routers/init.go View File

@@ -60,11 +60,17 @@ func NewServices() {
if err := storage.Init(); err != nil {
log.Fatal("storage init failed: %v", err)
}
log.Info("storage init succeed.")
mailer.NewContext()
log.Info("mailer.NewContext() succeed.")
_ = cache.NewContext()
log.Info("cache.NewContext() succeed.")
notification.NewContext()
log.Info("notification.NewContext() succeed.")
decompression.NewContext()
log.Info("decompression.NewContext() succeed.")
labelmsg.Init()
log.Info("labelmsg.Init() succeed.")
}

// In case of problems connecting to DB, retry connection. Eg, PGSQL in Docker Container on Synology


Loading…
Cancel
Save