mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Better handle error on webserver startup. Resolve #2057
This commit is contained in:
parent
0e401017ab
commit
e9212ff898
1 changed files with 13 additions and 4 deletions
|
|
@ -276,16 +276,25 @@ class WSGIWebServer(internet.TCPServer):
|
|||
Start the pool after the service starts.
|
||||
|
||||
"""
|
||||
super().startService()
|
||||
self.pool.start()
|
||||
try:
|
||||
super().startService()
|
||||
self.pool.start()
|
||||
except Exception:
|
||||
logger.log_trace("Webserver did not start correctly. Disabling.")
|
||||
self.stopService()
|
||||
|
||||
def stopService(self):
|
||||
"""
|
||||
Safely stop the pool after the service stops.
|
||||
|
||||
"""
|
||||
super().stopService()
|
||||
self.pool.stop()
|
||||
try:
|
||||
super().stopService()
|
||||
except Exception:
|
||||
logger.log_trace("Webserver stopService error.")
|
||||
finally:
|
||||
if self.pool.started:
|
||||
self.pool.stop()
|
||||
|
||||
|
||||
class PrivateStaticRoot(static.File):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue