File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -152,21 +152,18 @@ def unwatch(self, path: str) -> None:
152
152
self .observer .unschedule (self ._watch_refs .pop (path ))
153
153
154
154
def serve (self ):
155
- try :
156
- self .server_bind ()
157
- self .server_activate ()
155
+ self .server_bind ()
156
+ self .server_activate ()
158
157
159
- self .observer .start ()
158
+ self .observer .start ()
160
159
161
- paths_str = ", " .join (f"'{ _try_relativize_path (path )} '" for path in self ._watched_paths )
162
- log .info (f"Watching paths for changes: { paths_str } " )
160
+ paths_str = ", " .join (f"'{ _try_relativize_path (path )} '" for path in self ._watched_paths )
161
+ log .info (f"Watching paths for changes: { paths_str } " )
163
162
164
- log .info (f"Serving on { self .url } " )
165
- self .serve_thread .start ()
163
+ log .info (f"Serving on { self .url } " )
164
+ self .serve_thread .start ()
166
165
167
- self ._build_loop ()
168
- finally :
169
- self .server_close ()
166
+ self ._build_loop ()
170
167
171
168
def _build_loop (self ):
172
169
while True :
@@ -213,6 +210,7 @@ def shutdown(self, wait=False) -> None:
213
210
214
211
if self .serve_thread .is_alive ():
215
212
super ().shutdown ()
213
+ self .server_close ()
216
214
if wait :
217
215
self .serve_thread .join ()
218
216
self .observer .join ()
You can’t perform that action at this time.
0 commit comments