Increase ping timeout to 30 seconds
This commit is contained in:
parent
b30d1fe7f8
commit
f9d004a09d
1 changed files with 3 additions and 1 deletions
|
@ -20,6 +20,8 @@ import (
|
||||||
"go.mau.fi/mautrix-gmessages/libgm/util"
|
"go.mau.fi/mautrix-gmessages/libgm/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const phoneNotRespondingTimeout = 30 * time.Second
|
||||||
|
|
||||||
func (c *Client) doDittoPinger(log *zerolog.Logger, dittoPing chan struct{}, stopPinger chan struct{}) {
|
func (c *Client) doDittoPinger(log *zerolog.Logger, dittoPing chan struct{}, stopPinger chan struct{}) {
|
||||||
notResponding := false
|
notResponding := false
|
||||||
exit := false
|
exit := false
|
||||||
|
@ -40,7 +42,7 @@ func (c *Client) doDittoPinger(log *zerolog.Logger, dittoPing chan struct{}, sto
|
||||||
case <-pingChan:
|
case <-pingChan:
|
||||||
onRespond()
|
onRespond()
|
||||||
return
|
return
|
||||||
case <-time.After(15 * time.Second):
|
case <-time.After(phoneNotRespondingTimeout):
|
||||||
log.Warn().Msg("Ditto ping is taking long, phone may be offline")
|
log.Warn().Msg("Ditto ping is taking long, phone may be offline")
|
||||||
c.triggerEvent(&events.PhoneNotResponding{})
|
c.triggerEvent(&events.PhoneNotResponding{})
|
||||||
notResponding = true
|
notResponding = true
|
||||||
|
|
Loading…
Reference in a new issue