1
0
mirror of https://github.com/danog/amp.git synced 2024-11-26 20:15:00 +01:00

LibeventReactor::repeat() interpreted $msInterval as microseconds

This commit is contained in:
Bob Weinand 2015-09-10 21:21:57 +02:00
parent 8f884b0b9d
commit de205d29e1
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,7 @@
# dev # dev
- n/a - Repeat watchers in LibeventReactor internally were handled in
microsecond intervals instead of milliseconds.
### 1.0.3 ### 1.0.3

View File

@ -298,10 +298,11 @@ class LibeventReactor implements Reactor {
*/ */
public function repeat(callable $callback, $msInterval, array $options = []) { public function repeat(callable $callback, $msInterval, array $options = []) {
assert(($msInterval >= 0), "\$msInterval at Argument 2 expects integer >= 0"); assert(($msInterval >= 0), "\$msInterval at Argument 2 expects integer >= 0");
$msInterval *= 1000;
if (isset($options["ms_delay"])) { if (isset($options["ms_delay"])) {
$msDelay = (int) $options["ms_delay"]; $msDelay = (int) $options["ms_delay"];
assert(($msDelay >= 0), "ms_delay option expects integer >= 0"); assert(($msDelay >= 0), "ms_delay option expects integer >= 0");
$msDelay = ($msDelay * 1000); $msDelay *= 1000;
} else { } else {
$msDelay = $msInterval; $msDelay = $msInterval;
} }