Commits

JanKanis  committed 73668f6

implement exponential backoff

  • Participants
  • Parent commits baf734d

Comments (0)

Files changed (1)

File aanmeldscript-functions.php

 		$time = microtime(True) - $starttime;
 		if(!is_null($e)) {
 			$rqdata[] = array('ex'=>$e, 'time'=>$time);
-			if($tries < 3) {
+			if($tries < 4) {
+				// Do exponential backoff, see http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#ExponentialBackoff
+				usleep(pow(2,$tries-1)*1000000 + rand(0,1000)*1000);
 				$tries++;
 				continue;
 			} else {