Skip to content

Commit 3a2a292

Browse files
author
Willem Stuursma
committed
Decrease the maximum wait time we want to wait between checking to lock from 1 to 0.5s
1 parent e32e259 commit 3a2a292

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

classes/util/Loop.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ class Loop
2222
*
2323
* @var double
2424
*/
25-
private const MINIMUM_WAIT_US = 1e4;
25+
private const MINIMUM_WAIT_US = 1e4; // 0.01 seconds
2626

2727
/**
2828
* Maximum time that we want to wait, between lock checks. In micro seconds.
2929
*
3030
* @var double
3131
*/
32-
private const MAXIMUM_WAIT_US = 1e6;
32+
private const MAXIMUM_WAIT_US = 5e5; // 0.50 seconds
3333

3434
/**
3535
* @var int The timeout in seconds.
@@ -110,7 +110,7 @@ public function execute(callable $code)
110110
}
111111

112112
$min = min(
113-
(int) self::MINIMUM_WAIT_US * 1.5 ** $i,
113+
(int) self::MINIMUM_WAIT_US * 1.25 ** $i,
114114
self::MAXIMUM_WAIT_US
115115
);
116116
$max = min($min * 2, self::MAXIMUM_WAIT_US);

0 commit comments

Comments
 (0)