Skip to content

Instantly share code, notes, and snippets.

@jdx
Created May 9, 2015 19:01
Show Gist options
  • Save jdx/29aa78dff897c065bf9e to your computer and use it in GitHub Desktop.
Save jdx/29aa78dff897c065bf9e to your computer and use it in GitHub Desktop.
func Update(channel string) {
golock.Lock(updateLockPath)
defer golock.Unlock(updateLockPath)
done := make(chan bool)
go func() {
updateCLI(channel)
updatePlugins()
touchAutoupdateFile()
done <- true
}()
select {
case <-time.After(time.Second * 120):
Errln("Timed out while updating")
case <-done:
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment