Skip to content

Commit

Permalink
Infinite recursion fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rdlowrey committed Aug 12, 2013
1 parent d65224a commit c316405
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Alert/NativeReactor.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ private function executeAlarms() {
private function doAlarmCallback($watcherId, $now) {
list($callback, $nextExecution, $interval, $isRepeating) = $this->alarms[$watcherId];

$callback($watcherId);

if ($isRepeating) {
$nextExecution = $now + $interval;
$this->alarms[$watcherId] = [$callback, $nextExecution, $interval, $isRepeating];
Expand All @@ -132,6 +130,8 @@ private function doAlarmCallback($watcherId, $now) {
$this->alarmOrder[$watcherId]
);
}

$callback($watcherId);
}

function at(callable $callback, $timeString) {
Expand Down

0 comments on commit c316405

Please sign in to comment.