Skip to content

Commit

Permalink
Merge pull request #25 from WyriHaximus/resolve-small-possible-race-c…
Browse files Browse the repository at this point in the history
…ondition-in-wait-for-status-check-result

Resolve small possible race condition in WaitForStatusCheckResult
  • Loading branch information
WyriHaximus committed Aug 21, 2020
2 parents c70f068 + 2206731 commit 83538aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/WaitForStatusCheckResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public function __invoke(StatusCheckInterface $statusCheck): PromiseInterface
return new Promise(function (callable $resolve, callable $reject) use ($statusCheck): void {
$this->loop->addPeriodicTimer($this->interval, function (TimerInterface $timer) use ($statusCheck, $resolve): void {
if ($statusCheck->hasResolved()) {
$resolve($statusCheck->isSuccessful());
$this->loop->cancelTimer($timer);
$resolve($statusCheck->isSuccessful());

return;
}
Expand Down

0 comments on commit 83538aa

Please sign in to comment.