mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 04:17:55 +08:00
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:
committed by
GitHub
parent
7881ce32b2
commit
d4f200c2e1
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user