Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: zeripath <[email protected]>
  • Loading branch information
6543 and zeripath authored Sep 6, 2021
commit 2106a451f68d787ae2d02baa6f8cd6a678e903d6
12 changes: 6 additions & 6 deletions modules/setting/mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ var (
)

func newMirror() {
if err := Cfg.Section("mirror").MapTo(&Mirror); err != nil {
log.Fatal("Failed to map Mirror settings: %v", err)
}

// fallback to old config repository.DISABLE_MIRRORS
// Handle old configuration through `[repository]` `DISABLE_MIRRORS`
// - please note this was badly named and only disabled the creation of new pull mirrors
if Cfg.Section("repository").Key("DISABLE_MIRRORS").MustBool(false) {
log.Warn("Deprecated DISABLE_MIRRORS config is used, please change your config and use the optins within [mirror] section")
log.Warn("Deprecated DISABLE_MIRRORS config is used, please change your config and use the options within the [mirror] section")
// TODO: enable on v1.17.0: log.Error("Deprecated fallback used, will be removed in v1.18.0")
Mirror.DisableNewPull = true
}
if err := Cfg.Section("mirror").MapTo(&Mirror); err != nil {
log.Fatal("Failed to map Mirror settings: %v", err)
}

if !Mirror.Enabled {
Mirror.DisableNewPull = true
Expand Down