Skip to content

Commit

Permalink
instantly start presence on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
lieuweberg committed Mar 14, 2023
1 parent 75148ef commit 0741b6b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client/presence.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

func initPresence() {
exeCheckTicker := time.NewTicker(15 * time.Second)
exeCheckTicker := time.NewTicker(100 * time.Millisecond)
quitPresenceTicker = make(chan bool)
loggedIn := false
go func() {
Expand All @@ -27,6 +27,8 @@ func initPresence() {
quitPresenceTicker = nil
}()

firstTime := true

for {
select {
case <-exeCheckTicker.C:
Expand Down Expand Up @@ -84,6 +86,12 @@ func initPresence() {
exeCheckTicker.Stop()
errCount = 0
}

if firstTime {
firstTime = false
exeCheckTicker.Stop()
exeCheckTicker.Reset(15 * time.Second)
}
}
}()
}
Expand Down

0 comments on commit 0741b6b

Please sign in to comment.