mirror of
https://github.com/evennia/evennia.git
synced 2026-03-31 04:57:16 +02:00
Add extra checking for additional requests made while we were in the process of stopping reactor, change from callLater to deferLater to be compliant with inlinecallbacks.
This commit is contained in:
parent
4b5ee77292
commit
96ab620618
1 changed files with 9 additions and 2 deletions
|
|
@ -397,8 +397,15 @@ class Evennia(object):
|
|||
# this will also send a reactor.stop signal, so we set a
|
||||
# flag to avoid loops.
|
||||
self.shutdown_complete = True
|
||||
# kill the server
|
||||
reactor.callLater(1, reactor.stop)
|
||||
if WEBSERVER_ENABLED:
|
||||
# Just to be extra sure, get all pending requests that might have occurred after we started
|
||||
d = self.web_root.get_pending_requests()
|
||||
d.addCallback(lambda _: reactor.stop())
|
||||
from twisted.internet import task
|
||||
yield task.deferLater(reactor, 1, d.callback, None)
|
||||
else:
|
||||
# kill the server
|
||||
reactor.callLater(1, reactor.stop)
|
||||
|
||||
# we make sure the proper gametime is saved as late as possible
|
||||
ServerConfig.objects.conf("runtime", _GAMETIME_MODULE.runtime())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue