Commit ba05893 1 parent 945b0fa commit ba05893 Copy full SHA for ba05893
File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -85,11 +85,12 @@ def stop_refresh():
85
85
active_timer .cancel ()
86
86
87
87
def async_refresh ():
88
+ if shutting_down :
89
+ return
90
+
88
91
store .refresh_registry ()
89
92
nonlocal registry_proto
90
93
registry_proto = store .registry .proto ()
91
- if shutting_down :
92
- return
93
94
94
95
if registry_ttl_sec :
95
96
nonlocal active_timer
@@ -222,8 +223,12 @@ def write_to_online_store(body=Depends(get_body)):
222
223
)
223
224
224
225
@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
+ )
227
232
228
233
@app .post ("/materialize" , dependencies = [Depends (inject_user_details )])
229
234
def materialize (body = Depends (get_body )):
You can’t perform that action at this time.
0 commit comments