diff --git a/docs/Config.md b/docs/Config.md index 951686073..77685a378 100644 --- a/docs/Config.md +++ b/docs/Config.md @@ -86,7 +86,7 @@ os: openCommand: '' refresher: refreshInterval: 10 # File/submodule refresh interval in seconds. Auto-refresh can be disabled via option 'git.autoRefresh'. - fetchInterval: 60 # re-fetch interval in seconds + fetchInterval: 60 # Re-fetch interval in seconds. Auto-fetch can be disabled via option 'git.autoFetch'. update: method: prompt # can be: prompt | background | never days: 14 # how often an update is checked for diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index 3848f2bd9..ba2d85a27 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -583,8 +583,16 @@ func (gui *Gui) Run(filterPath string) error { } gui.waitForIntro.Add(1) - if gui.c.UserConfig.Git.AutoFetch { - go utils.Safe(gui.startBackgroundFetch) + + if userConfig.Git.AutoFetch { + fetchInterval := userConfig.Refresher.FetchInterval + if fetchInterval > 0 { + go utils.Safe(gui.startBackgroundFetch) + } else { + gui.c.Log.Errorf( + "Value of config option 'refresher.fetchInterval' (%d) is invalid, disabling auto-fetch", + fetchInterval) + } } if userConfig.Git.AutoRefresh {