Skip to content

Commit

Permalink
Enable regular autoupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
Arno500 committed Feb 21, 2024
1 parent d822240 commit 4fa78b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions plex-richpresence.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ func onReady() {
i18n.InitLocale()
settings.Load()
gui.SetupTray()
autoupdate.Autoupdate()
go func() {
for {
autoupdate.Autoupdate()
time.Sleep(6 * time.Hour)
}
}()
ctx, cancelMain := context.WithCancel(context.Background())
go mainFunc(ctx)
defer func() {
Expand Down Expand Up @@ -76,8 +81,8 @@ func onReady() {
func disconnectSockets(sockets *map[string]*chan interface{}) {
for _, socket := range *sockets {
select {
case *socket <- true:
default:
case *socket <- true:
default:
}
}
*sockets = make(map[string]*chan interface{})
Expand Down
4 changes: 2 additions & 2 deletions plex/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ func StartWebsocketConnections(server plex.PMSDevices, accountData plex.UserPlex
log.Printf("Couldn't connect or lost connection to %s", server.Name)
log.Println(err)
select {
case cancelChan <- true:
default:
case cancelChan <- true:
default:
}
onConnectionClose()
}
Expand Down

0 comments on commit 4fa78b0

Please sign in to comment.