Skip to content

Commit d164646

Browse files
committed
chore: simplify lifespan setup
1 parent 9e404bc commit d164646

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/stac_auth_proxy/app.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,13 @@ def create_app(settings: Optional[Settings] = None) -> FastAPI:
3131
#
3232
# Application
3333
#
34-
upstream_urls = [
35-
settings.upstream_url,
36-
settings.oidc_discovery_internal_url or settings.oidc_discovery_url,
37-
]
34+
upstream_urls = (
35+
[settings.upstream_url, settings.oidc_discovery_internal_url]
36+
if settings.wait_for_upstream
37+
else []
38+
)
3839
lifespan = LifespanManager(
39-
on_startup=(
40-
[ServerHealthCheck(url=url) for url in upstream_urls]
41-
if settings.wait_for_upstream
42-
else []
43-
)
40+
on_startup=([ServerHealthCheck(url=url) for url in upstream_urls])
4441
)
4542

4643
app = FastAPI(

0 commit comments

Comments
 (0)