fix: changing default numWorkers, making it customizable and refactoring scheduler (#1563)

Signed-off-by: Lisca Ana-Roberta <ana.kagome@yahoo.com>
This commit is contained in:
Lisca Ana-Roberta
2023-07-04 11:03:29 +03:00
committed by GitHub
parent 7881ce32b2
commit d4f200c2e1
14 changed files with 101 additions and 29 deletions
+5
View File
@@ -74,6 +74,10 @@ type HTTPConfig struct {
Ratelimit *RatelimitConfig `mapstructure:",omitempty"`
}
type SchedulerConfig struct {
NumWorkers int
}
type LDAPConfig struct {
Port int
Insecure bool
@@ -151,6 +155,7 @@ type Config struct {
HTTP HTTPConfig
Log *LogConfig
Extensions *extconf.ExtensionConfig
Scheduler *SchedulerConfig `json:"scheduler" mapstructure:",omitempty"`
}
func New() *Config {
+1 -1
View File
@@ -312,7 +312,7 @@ func (c *Controller) Shutdown() {
}
func (c *Controller) StartBackgroundTasks(reloadCtx context.Context) {
taskScheduler := scheduler.NewScheduler(c.Log)
taskScheduler := scheduler.NewScheduler(c.Config, c.Log)
taskScheduler.RunScheduler(reloadCtx)
// Enable running garbage-collect periodically for DefaultStore