mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Fix bus resolver to look up context container per dispatch
The resources/context migration replaced the resolver closure with a first-class callable from `$swoole->context()->get(...)`. That captures the result of `$swoole->context()` once -- on the first dispatch -- and binds the bus to the first request's per-request container forever after. Wrap the lookup in a fresh closure so each dispatch re-resolves `context()` against the current Swoole coroutine. Restores the behavior of the pre-migration `getContainer()` form. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
040ce6e335
commit
93e96a044d
+1
-1
@@ -191,7 +191,7 @@ $http->on(Constant::EVENT_AFTER_RELOAD, function ($server) {
|
||||
Console::success('Reload completed...');
|
||||
});
|
||||
|
||||
$container->set('bus', fn ($register) => $register->get('bus')->setResolver($swoole->context()->get(...)), ['register']);
|
||||
$container->set('bus', fn ($register) => $register->get('bus')->setResolver(fn (string $name) => $swoole->context()->get($name)), ['register']);
|
||||
|
||||
include __DIR__ . '/controllers/general.php';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user