From 51dae5f2182768ebff1b60f8c5f789b23bd3d60c Mon Sep 17 00:00:00 2001 From: Willem Stuursma-Ruwen Date: Sat, 26 May 2018 13:20:42 +0200 Subject: [PATCH] Back of somewhat slower (use back off factor of 1.5 instead of 2) --- classes/util/Loop.php | 2 +- tests/mutex/PredisMutexTest.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/classes/util/Loop.php b/classes/util/Loop.php index db33adae..2e696a6d 100644 --- a/classes/util/Loop.php +++ b/classes/util/Loop.php @@ -78,7 +78,7 @@ public function execute(callable $code) break; } - $min = $minWait * 2 ** $i; + $min = (int) $minWait * 1.5 ** $i; $max = $min * 2; /* diff --git a/tests/mutex/PredisMutexTest.php b/tests/mutex/PredisMutexTest.php index 29fe6f8e..a45b71ae 100644 --- a/tests/mutex/PredisMutexTest.php +++ b/tests/mutex/PredisMutexTest.php @@ -54,7 +54,8 @@ private function getPredisConfig() return array_map( function ($redisUri) { return str_replace("redis://", "tcp://", $redisUri); - }, $servers + }, + $servers ); }