mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 21:17:58 +08:00
Sync images with a background context (#3537)
feat: Sync images with a background context This means syncs/pulls will not be cancelled anymore when the requesting client disconnects. The timeout used can be configured per registry Signed-off-by: Lars Francke <git@lars-francke.de>
This commit is contained in:
@@ -663,9 +663,15 @@ func applyDefaultValues(config *config.Config, viperInstance *viper.Viper, logge
|
||||
config.Extensions.Sync.Enable = &defaultVal
|
||||
}
|
||||
|
||||
for id, regCfg := range config.Extensions.Sync.Registries {
|
||||
defaultSyncTimeout := 3 * time.Hour
|
||||
|
||||
for idx, regCfg := range config.Extensions.Sync.Registries {
|
||||
if regCfg.TLSVerify == nil {
|
||||
config.Extensions.Sync.Registries[id].TLSVerify = &defaultVal
|
||||
config.Extensions.Sync.Registries[idx].TLSVerify = &defaultVal
|
||||
}
|
||||
|
||||
if config.Extensions.Sync.Registries[idx].SyncTimeout == 0 {
|
||||
config.Extensions.Sync.Registries[idx].SyncTimeout = defaultSyncTimeout
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user