Skip to content

Commit 33816bc

Browse files
authored
Merge pull request #233 from python-ellar/ensure_build_context_fix
fixed app ready check
2 parents 5b6bd9f + 2c3906c commit 33816bc

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

ellar/events/build.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,12 @@ def _reg() -> t.Any:
5656
functools.partial(_on_context, f, _func_args)
5757
)
5858

59-
if _injector_context_var.get() is empty and not app_ready:
59+
if _injector_context_var.get() is empty:
6060
# Defer till when injector_context is ready
6161
return _reg()
62-
elif (
63-
_injector_context_var.get() is not empty
64-
and app_ready
65-
and fail_silently(_injector_context_var.get().get, "App") is None
66-
):
62+
63+
app = fail_silently(_injector_context_var.get().get, "App")
64+
if _injector_context_var.get() is not empty and app_ready and app is None:
6765
# Defer till when the app is ready
6866
return _reg()
6967

0 commit comments

Comments
 (0)