From ce66b82ce46948b8c2a74a17a1d75d7510e77f7f Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Fri, 7 Mar 2014 12:56:11 -0400 Subject: add ability to set nice order via env var --- Makefile | 1 + src/leap/bitmask/app.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 2bd39eb0..b637fefc 100644 --- a/Makefile +++ b/Makefile @@ -82,6 +82,7 @@ view_lineprof: @python -m line_profiler app.py.lprof | $(EDITOR) - resource_graph: + #./pkg/scripts/monitor_resource.zsh `pgrep twistd` $(RESOURCE_TIME) ./pkg/scripts/monitor_resource.zsh `pgrep bitmask` $(RESOURCE_TIME) display bitmask-resources.png diff --git a/src/leap/bitmask/app.py b/src/leap/bitmask/app.py index 1146d1d0..2034bc33 100644 --- a/src/leap/bitmask/app.py +++ b/src/leap/bitmask/app.py @@ -236,6 +236,11 @@ def main(): # We don't even have logger configured in here print "Could not ensure server: %r" % (e,) + PLAY_NICE = os.environ.get("LEAP_NICE") + if PLAY_NICE and PLAY_NICE.isdigit(): + nice = os.nice(int(PLAY_NICE)) + logger.info("Setting NICE: %s" % nice) + # And then we import all the other stuff # I think it's safe to import at the top by now -- kali from leap.bitmask.gui import locale_rc -- cgit v1.2.3