From: Diogo Franco (Kovensky) Date: Tue, 16 Jul 2013 17:03:32 +0000 (-0300) Subject: anidb: Change retry timer factors X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=b5d7724e6c92388c4726c6c495b4f67443dc7056;p=go-anidb.git anidb: Change retry timer factors Now gives a progression of 10s, 20s, 40s and 60s waits. --- diff --git a/udp.go b/udp.go index 099ae7d..89b39d8 100644 --- a/udp.go +++ b/udp.go @@ -113,7 +113,7 @@ func logReply(reply udpapi.APIReply) { } func (udp *udpWrap) sendQueue() { - initialWait := 6 * time.Second + initialWait := 5 * time.Second wait := initialWait for set := range udp.sendQueueCh { Retry: @@ -128,7 +128,7 @@ func (udp *udpWrap) sendQueue() { if reply.Error() == udpapi.TimeoutError { // retry - wait = (wait * 15) / 10 + wait = wait * 2 if wait > time.Minute { wait = time.Minute }