mirror of
https://github.com/evennia/evennia.git
synced 2026-03-24 16:56:32 +01:00
Fix server-time-snapshot unittest patch issue
This commit is contained in:
parent
dff5d9e5df
commit
dfea32ec82
2 changed files with 6 additions and 1 deletions
|
|
@ -105,7 +105,7 @@ _IDMAPPER_CACHE_MAXSIZE = settings.IDMAPPER_CACHE_MAXSIZE
|
|||
_GAMETIME_MODULE = None
|
||||
|
||||
_IDLE_TIMEOUT = settings.IDLE_TIMEOUT
|
||||
_LAST_SERVER_TIME_SNAPSHOT = None
|
||||
_LAST_SERVER_TIME_SNAPSHOT = 0
|
||||
|
||||
|
||||
def _server_maintenance():
|
||||
|
|
@ -128,6 +128,7 @@ def _server_maintenance():
|
|||
# first call after a reload
|
||||
_GAMETIME_MODULE.SERVER_START_TIME = now
|
||||
_GAMETIME_MODULE.SERVER_RUNTIME = ServerConfig.objects.conf("runtime", default=0.0)
|
||||
_LAST_SERVER_TIME_SNAPSHOT = now
|
||||
else:
|
||||
# adjust the runtime not with 60s but with the actual elapsed time
|
||||
# in case this may varies slightly from 60s.
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ class TestServer(TestCase):
|
|||
connection=DEFAULT,
|
||||
_IDMAPPER_CACHE_MAXSIZE=1000,
|
||||
_MAINTENANCE_COUNT=3600 - 1,
|
||||
_LAST_SERVER_TIME_SNAPSHOT=0,
|
||||
ServerConfig=DEFAULT,
|
||||
) as mocks:
|
||||
mocks["connection"].close = MagicMock()
|
||||
|
|
@ -84,6 +85,7 @@ class TestServer(TestCase):
|
|||
connection=DEFAULT,
|
||||
_IDMAPPER_CACHE_MAXSIZE=1000,
|
||||
_MAINTENANCE_COUNT=3700 - 1,
|
||||
_LAST_SERVER_TIME_SNAPSHOT=0,
|
||||
ServerConfig=DEFAULT,
|
||||
) as mocks:
|
||||
mocks["connection"].close = MagicMock()
|
||||
|
|
@ -101,6 +103,7 @@ class TestServer(TestCase):
|
|||
connection=DEFAULT,
|
||||
_IDMAPPER_CACHE_MAXSIZE=1000,
|
||||
_MAINTENANCE_COUNT=(3600 * 7) - 1,
|
||||
_LAST_SERVER_TIME_SNAPSHOT=0,
|
||||
ServerConfig=DEFAULT,
|
||||
) as mocks:
|
||||
mocks["connection"].close = MagicMock()
|
||||
|
|
@ -117,6 +120,7 @@ class TestServer(TestCase):
|
|||
connection=DEFAULT,
|
||||
_IDMAPPER_CACHE_MAXSIZE=1000,
|
||||
_MAINTENANCE_COUNT=(3600 * 7) - 1,
|
||||
_LAST_SERVER_TIME_SNAPSHOT=0,
|
||||
SESSIONS=DEFAULT,
|
||||
_IDLE_TIMEOUT=10,
|
||||
time=DEFAULT,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue