Add longer hacky sleep to make google login post-connect work

This commit is contained in:
Tulir Asokan 2024-03-11 15:06:23 +02:00
parent c8478eaa33
commit 114cf622d6

View file

@ -166,10 +166,16 @@ func (c *Client) Connect() error {
func (c *Client) postConnect() { func (c *Client) postConnect() {
time.Sleep(2 * time.Second) time.Sleep(2 * time.Second)
c.Logger.Debug().Msg("Sending acks before get updates request") if c.skipCount > 0 {
c.Logger.Warn().Int("skip_count", c.skipCount).Msg("Skip count is non-zero in postConnect, waiting longer")
for i := 0; i < 10 && c.skipCount > 0; i++ {
time.Sleep(1 * time.Second)
}
if c.skipCount > 0 { if c.skipCount > 0 {
c.Logger.Warn().Int("skip_count", c.skipCount).Msg("Skip count is still non-zero") c.Logger.Warn().Int("skip_count", c.skipCount).Msg("Skip count is still non-zero")
} }
}
c.Logger.Debug().Msg("Sending acks before get updates request")
c.sessionHandler.sendAckRequest() c.sessionHandler.sendAckRequest()
time.Sleep(1 * time.Second) time.Sleep(1 * time.Second)
c.Logger.Debug().Msg("Sending get updates request") c.Logger.Debug().Msg("Sending get updates request")