Minor bugfix

This commit is contained in:
Daniil Gentili 2019-05-30 17:27:22 +02:00
parent 060659dc92
commit 2039667f82

View File

@ -301,8 +301,13 @@ trait ResponseHandler
{ {
if (isset($request['promise']) && is_object($request['promise'])) { if (isset($request['promise']) && is_object($request['promise'])) {
Loop::defer(function () use (&$request, $data) { Loop::defer(function () use (&$request, $data) {
$request['promise']->fail($data); if (isset($request['promise'])) {
unset($request['promise']); $request['promise']->fail($data);
unset($request['promise']);
} else {
$this->logger->logger('Rejecting: already got response for '.(isset($request['_']) ? $request['_'] : '-'));
$this->logger->logger("Rejecting: $data");
}
}); });
} elseif (isset($request['container'])) { } elseif (isset($request['container'])) {
foreach ($request['container'] as $message_id) { foreach ($request['container'] as $message_id) {