Skip to content

Commit

Permalink
Merge pull request #233 from python-ellar/ensure_build_context_fix
Browse files Browse the repository at this point in the history
fixed app ready check
  • Loading branch information
eadwinCode authored Aug 21, 2024
2 parents 5b6bd9f + 2c3906c commit 33816bc
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions ellar/events/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,12 @@ def _reg() -> t.Any:
functools.partial(_on_context, f, _func_args)
)

if _injector_context_var.get() is empty and not app_ready:
if _injector_context_var.get() is empty:
# Defer till when injector_context is ready
return _reg()
elif (
_injector_context_var.get() is not empty
and app_ready
and fail_silently(_injector_context_var.get().get, "App") is None
):

app = fail_silently(_injector_context_var.get().get, "App")
if _injector_context_var.get() is not empty and app_ready and app is None:
# Defer till when the app is ready
return _reg()

Expand Down

0 comments on commit 33816bc

Please sign in to comment.