Explicitly close db connection from portal, address #1183.

This commit is contained in:
Griatch 2017-08-27 15:44:41 +02:00
parent 92df3ce5ae
commit 21d3dcb044
2 changed files with 10 additions and 0 deletions

View file

@ -36,6 +36,7 @@ class ClosedLidState(DefaultScript):
def at_script_creation(self):
"Called when script first created."
self.key = "closed_lid_script"
self.desc = "Script that manages the closed-state cmdsets for red button."
self.persistent = True
@ -72,6 +73,7 @@ class OpenLidState(DefaultScript):
def at_script_creation(self):
"Called when script first created."
self.key = "open_lid_script"
self.desc = "Script that manages the opened-state cmdsets for red button."
self.persistent = True

View file

@ -28,6 +28,14 @@ evennia._init()
from evennia.utils.utils import get_evennia_version, mod_import, make_iter
from evennia.server.portal.portalsessionhandler import PORTAL_SESSIONS
from evennia.server.webserver import EvenniaReverseProxyResource
from django.db import connection
# we don't need a connection to the database so close it right away
try:
connection.close()
except Exception:
pass
PORTAL_SERVICES_PLUGIN_MODULES = [mod_import(module) for module in make_iter(settings.PORTAL_SERVICES_PLUGIN_MODULES)]
LOCKDOWN_MODE = settings.LOCKDOWN_MODE