File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -85,11 +85,12 @@ def stop_refresh():
8585 active_timer .cancel ()
8686
8787 def async_refresh ():
88+ if shutting_down :
89+ return
90+
8891 store .refresh_registry ()
8992 nonlocal registry_proto
9093 registry_proto = store .registry .proto ()
91- if shutting_down :
92- return
9394
9495 if registry_ttl_sec :
9596 nonlocal active_timer
@@ -222,8 +223,12 @@ def write_to_online_store(body=Depends(get_body)):
222223 )
223224
224225 @app .get ("/health" )
225- def health ():
226- return Response (status_code = status .HTTP_200_OK )
226+ async def health ():
227+ return (
228+ Response (status_code = status .HTTP_200_OK )
229+ if registry_proto
230+ else Response (status_code = status .HTTP_503_SERVICE_UNAVAILABLE )
231+ )
227232
228233 @app .post ("/materialize" , dependencies = [Depends (inject_user_details )])
229234 def materialize (body = Depends (get_body )):
You can’t perform that action at this time.
0 commit comments