Skip to content

Commit

Permalink
Work around OPCache issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Jul 1, 2017
1 parent f9f0c6c commit e0fc018
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/Internal/Socket.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ public function ask(Question $question, int $timeout): Promise {
}

try {
return yield Promise\timeout($deferred->promise(), $timeout);
// Work around an OPCache issue that returns an empty array with "return yield ...", so assign to a variable first.
// See https://github.com/amphp/dns/issues/58.
$result = yield Promise\timeout($deferred->promise(), $timeout);
return $result;
} catch (Amp\TimeoutException $exception) {
unset($this->pending[$id]);

Expand Down

0 comments on commit e0fc018

Please sign in to comment.