]> git.lizzy.rs Git - go-anidb.git/commitdiff
anidb: Change retry timer factors
authorDiogo Franco (Kovensky) <diogomfranco@gmail.com>
Tue, 16 Jul 2013 17:03:32 +0000 (14:03 -0300)
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>
Tue, 16 Jul 2013 17:03:32 +0000 (14:03 -0300)
Now gives a progression of 10s, 20s, 40s and 60s waits.

udp.go

diff --git a/udp.go b/udp.go
index 099ae7df60d75108eb6ea8cf0c40dba47ccc1350..89b39d8ee3b7008db1482116393c63a1ad3b7ae0 100644 (file)
--- 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
                        }