updated SPM lib
This commit is contained in:
parent
cb63af8017
commit
4674c727f0
3 changed files with 13 additions and 5 deletions
12
main.go
12
main.go
|
@ -205,8 +205,16 @@ func runBackgroundUpdater() {
|
|||
|
||||
// Main loop for periodic AutoDownloadUpdates and AutoInstallUpdates
|
||||
for {
|
||||
err := spm.UpdateIndex()
|
||||
if err != nil {
|
||||
log.Printf("APPINDEX update failed: %v\n", err)
|
||||
WriteState(false, 0, fmt.Sprintf("Update failed: %v", err))
|
||||
time.Sleep(10 * time.Second)
|
||||
continue
|
||||
}
|
||||
|
||||
// Run AutoDownloadUpdates every 10 seconds
|
||||
err := spm.AutoDownloadUpdates()
|
||||
err = spm.DownloadUpdates()
|
||||
if err != nil {
|
||||
log.Printf("AutoDownloadUpdates failed: %v\n", err)
|
||||
WriteState(false, 0, fmt.Sprintf("Update failed: %v", err))
|
||||
|
@ -223,7 +231,7 @@ func runBackgroundUpdater() {
|
|||
|
||||
// If the browser is not running, run AutoInstallUpdates
|
||||
log.Println("\nBrowser is not running. Starting installation of updates.")
|
||||
err = spm.AutoInstallUpdates()
|
||||
err = spm.InstallUpdates()
|
||||
if err != nil {
|
||||
log.Printf("AutoInstallUpdates failed: %v\n", err)
|
||||
WriteState(false, 0, fmt.Sprintf("Installation failed: %v", err))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue