updated SPM lib
All checks were successful
/ test-on-windows (push) Successful in 10s
/ test-on-alpine (push) Successful in 4s

This commit is contained in:
partisan 2025-03-02 11:34:50 +01:00
parent cb63af8017
commit 4674c727f0
3 changed files with 13 additions and 5 deletions

12
main.go
View file

@ -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))