New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix auto-update panic #551
Conversation
@@ -215,7 +229,6 @@ func (updater *UpdaterService) compareScannerNodeVersion(previousRef string) (ne | |||
|
|||
func (updater *UpdaterService) checkNewerReleaseAndWait(previousRef string, delay time.Duration) (foundNew bool) { | |||
detectedCh := make(chan struct{}) | |||
defer close(detectedCh) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was causing a closed channel send panic. Removing it as the channel is deallocated anyways.
@@ -115,7 +115,7 @@ func (updater *UpdaterService) Start() error { | |||
updater.stopServer() | |||
return | |||
case <-t.C: | |||
err := updater.updateLatestReleaseWithDelay(updater.updateCheckInterval) | |||
err := updater.updateLatestReleaseWithDelay(updater.updateDelay) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This caused referencing a wrong delay duration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
services/updater/updater.go
No description provided.