Skip to content

Commit

Permalink
config: add post-cmd-executor pool size (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
luxcgo authored Jul 8, 2022
1 parent 85f3b7f commit 99e5d98
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
19 changes: 17 additions & 2 deletions src/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,27 @@ var (
)

type appConfig struct {
LogLevel logrus.Level
SnapRestSeconds uint32
LogLevel logrus.Level
SnapRestSeconds uint
CommanderPoolSize uint

*UploadConfig
*PlatformConfig
Shows []*Show
}

func (this *appConfig) checkAndFix() {
if this.LogLevel == 0 {
this.LogLevel = logrus.DebugLevel
}
if this.SnapRestSeconds == 0 {
this.SnapRestSeconds = 15
}
if this.CommanderPoolSize == 0 {
this.CommanderPoolSize = 1
}
}

type Show struct {
Platform string
RoomID string
Expand Down Expand Up @@ -108,6 +121,8 @@ func verify() {
l.Logger.Info("use default APP config")
APP = &defaultAPP
}
APP.checkAndFix()

l.Logger.SetLevel(APP.LogLevel)

if APP.UploadConfig == nil {
Expand Down
2 changes: 1 addition & 1 deletion src/uploader/uploader.worker_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
l "github.com/go-olive/olive/src/log"
)

var UploaderWorkerPool = NewWorkerPool(1)
var UploaderWorkerPool = NewWorkerPool(config.APP.CommanderPoolSize)

func init() {
if !config.APP.UploadConfig.Enable {
Expand Down

0 comments on commit 99e5d98

Please sign in to comment.