diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2026-01-19 07:35:08 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2026-01-19 08:25:14 +0000 |
| commit | 45ab0e9513c6f93e72783f0801128eadf774178d (patch) | |
| tree | 06f4cf31bf1deb49d8646f9812b25648afcfea51 | |
| parent | 20d37d280693b1646e3bd33ab3d8a0a947830a8e (diff) | |
pkg/updater: fix autoupdate
Start update goroutine even in the case of early returns in UpdateOnStart.
Fixes #6619
| -rw-r--r-- | pkg/updater/updater.go | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/pkg/updater/updater.go b/pkg/updater/updater.go index ed4938609..e4420af83 100644 --- a/pkg/updater/updater.go +++ b/pkg/updater/updater.go @@ -125,6 +125,15 @@ func New(cfg *Config) (*Updater, error) { // - ensures that the current executable is fresh // - ensures that we have a working syzkaller build in current func (upd *Updater) UpdateOnStart(autoupdate bool, updatePending, shutdown chan struct{}) { + if autoupdate { + defer func() { + go func() { + upd.waitForUpdate() + close(updatePending) + }() + }() + } + os.RemoveAll(upd.currentDir) latestTag := upd.checkLatest() if latestTag != "" { @@ -180,12 +189,6 @@ func (upd *Updater) UpdateOnStart(autoupdate bool, updatePending, shutdown chan os.Exit(0) } } - if autoupdate { - go func() { - upd.waitForUpdate() - close(updatePending) - }() - } } // waitForUpdate polls and rebuilds syzkaller. |
