updated SPM lib
This commit is contained in:
parent
cb63af8017
commit
4674c727f0
3 changed files with 13 additions and 5 deletions
2
go.mod
2
go.mod
|
@ -4,7 +4,7 @@ go 1.23.4
|
|||
|
||||
require (
|
||||
github.com/gen2brain/raylib-go/raylib v0.0.0-20250109172833-6dbba4f81a9b
|
||||
weforge.xyz/Spitfire/SPM v0.0.3
|
||||
weforge.xyz/Spitfire/SPM v0.1.2
|
||||
)
|
||||
|
||||
require (
|
||||
|
|
4
go.sum
4
go.sum
|
@ -17,5 +17,5 @@ gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
|
|||
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
weforge.xyz/Spitfire/SPM v0.0.3 h1:+NXeNzfOjE935Aqf6bvnx+DmgE/D63orwNrx8aYwC/8=
|
||||
weforge.xyz/Spitfire/SPM v0.0.3/go.mod h1:LkLCJPROt/UW0Ntlbm1Vk8CpqpBscY0IScfT3PprsC4=
|
||||
weforge.xyz/Spitfire/SPM v0.1.2 h1:jY3WvRV5WFE9spne1YFGQNPOnnZqAxnZaa3l57pTigw=
|
||||
weforge.xyz/Spitfire/SPM v0.1.2/go.mod h1:LkLCJPROt/UW0Ntlbm1Vk8CpqpBscY0IScfT3PprsC4=
|
||||
|
|
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
Reference in a new issue