mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 01:18:37 +00:00
Fix setting nested promise
This commit is contained in:
parent
10449822ce
commit
75fec18356
1 changed files with 3 additions and 3 deletions
|
|
@ -181,8 +181,10 @@ class SwoolePromise
|
|||
private function setResult(mixed $value): void
|
||||
{
|
||||
if (!$value instanceof SwoolePromise) {
|
||||
throw new \RuntimeException('Supported only Appwrite\GraphQL\SwoolePromise instance');
|
||||
$this->result = $value;
|
||||
return;
|
||||
}
|
||||
|
||||
$resolved = false;
|
||||
$callable = function ($value) use (&$resolved) {
|
||||
$this->setResult($value);
|
||||
|
|
@ -193,8 +195,6 @@ class SwoolePromise
|
|||
while (!$resolved) {
|
||||
usleep(25000);
|
||||
}
|
||||
|
||||
$this->result = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue