Browse files

add ability to set max_memory via config

  • Loading branch information...
1 parent 9d2c648 commit 0df3c394b541011fd28cb7de6fef4a28a24717c4 @vadimg vadimg committed Apr 22, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 sandbox/config.py
View
8 sandbox/config.py
@@ -210,9 +210,13 @@ def _set_timeout(self, timeout):
self._timeout = None
timeout = property(_get_timeout, _set_timeout)
- @property
- def max_memory(self):
+ def _get_max_memory(self):
return self._max_memory
+ def _set_max_memory(self, mb):
+ if not self._use_subprocess:
+ raise NotImplementedError("Max Memory requires the subprocess mode")
+ self._max_memory = mb * 1024 * 1024
+ max_memory = property(_get_max_memory, _set_max_memory)
@property
def max_input_size(self):

0 comments on commit 0df3c39

Please sign in to comment.