Turned off Django DEBUG in the default setup. This resolves all issues with memory leakage and resource hogging seen in issue112.

This commit is contained in:
Griatch 2010-10-11 17:22:39 +00:00
parent 12acb34ce7
commit 151595a042
4 changed files with 18 additions and 15 deletions

View file

@ -10,6 +10,7 @@ from src.server import sessionhandler
from src.players.models import PlayerDB
from src.scripts.models import ScriptDB
from src.objects.models import ObjectDB
from src.config.models import ConfigValue
from src.permissions.models import PermissionGroup
from src.utils import reloads, create, logger, utils
from src.permissions.permissions import has_perm, has_perm_string
@ -92,11 +93,13 @@ class CmdPy(MuxCommand):
'testscript')
obj = create.create_object("src.objects.objects.Object",
'testobject')
conf = ConfigValue() # used to access conf values
available_vars = {'self':caller,
'me':caller,
'here':caller.location,
'obj':obj,
'script':script}
'script':script,
'config':conf}
caller.msg(">>> %s" % pycode)
try:
ret = eval(pycode, {}, available_vars)

View file

@ -88,7 +88,7 @@ def import_cmdset(python_path, cmdsetobj, emit_to_obj=None, no_logging=False):
try:
try:
print "importing %s: CACHED_CMDSETS=%s" % (python_path, CACHED_CMDSETS)
#print "importing %s: CACHED_CMDSETS=%s" % (python_path, CACHED_CMDSETS)
wanted_cache_key = python_path
cmdsetclass = CACHED_CMDSETS.get(wanted_cache_key, None)
errstring = ""
@ -99,7 +99,7 @@ def import_cmdset(python_path, cmdsetobj, emit_to_obj=None, no_logging=False):
module = __import__(modulepath, fromlist=[True])
cmdsetclass = module.__dict__[classname]
CACHED_CMDSETS[wanted_cache_key] = cmdsetclass
print "cmdset %s found." % wanted_cache_key
#print "cmdset %s found." % wanted_cache_key
#instantiate the cmdset (and catch its errors)
if callable(cmdsetclass):
cmdsetclass = cmdsetclass(cmdsetobj)
@ -164,6 +164,8 @@ class CmdSetHandler(object):
# this tracks which mergetypes are actually in play in the stack
self.mergetype_stack = ["Union"]
self.update()
#print "cmdsethandler init. id:%s, obj:%s, cmdsetstack:%s " % (id(self), self.obj.key, [cmdset.key for cmdset in self.cmdset_stack])
def __str__(self):
"Display current commands"

View file

@ -26,8 +26,6 @@ def create_config_values():
ConfigValue.objects.conf("default_home", "2")
ConfigValue.objects.conf("site_name", settings.SERVERNAME)
ConfigValue.objects.conf("idle_timeout", settings.IDLE_TIMEOUT)
#ConfigValue.objects.conf("money_name_singular", "Credit")
#ConfigValue.objects.conf("money_name_plural", "Credits")
def create_connect_screens():
"""

View file

@ -65,16 +65,15 @@ LANGUAGE_CODE = 'en-us'
# since it creates a lot of help entries that has nothing to do
# with what is actually available in the game.
IMPORT_MUX_HELP = False
# How long time (seconds) a user may idle before being logged
# How long time (in seconds) a user may idle before being logged
# out. This can be set as big as desired. A user may avoid being
# thrown off by sending the empty system command 'idle' to the server
# at regular intervals.
# at regular intervals. Set <=0 to deactivate idle timout completely.
IDLE_TIMEOUT = 3600
# The set of encodings tried. A Player object may set an attribute "encoding" on
# itself to match the client used. If not set, or wrong encoding is
# given, this list is tried, in order, aborting on the first match.
# Add sets for languages/regions your players are likely to use.
# (see http://en.wikipedia.org/wiki/Character_encoding)
# If the PlayerAttribute 'encoding' is not set, or wrong encoding is
# given, this list is tried, in order, stopping on the first match.
# Add sets for languages/regions your players are likely to use. (see
# http://en.wikipedia.org/wiki/Character_encoding).
ENCODINGS = ["utf-8", "latin-1", "ISO-8859-1"]
###################################################
@ -314,9 +313,10 @@ IRC_NICKNAME = ""
# While DEBUG is False, show a regular server error page on the web
# stuff, email the traceback to the people in the ADMINS tuple
# below. By default (True), show a detailed traceback for the web
# browser to display.
DEBUG = True
# below. If True, show a detailed traceback for the web
# browser to display. Note however that this might leak memory when
# active, so make sure turn it off for a production server!
DEBUG = False
# While true, show "pretty" error messages for template syntax errors.
TEMPLATE_DEBUG = DEBUG
# Emails are sent to these people if the above DEBUG value is False. If you'd