Run all the jobs at a low priority
This commit is contained in:
parent
f13d427075
commit
43e61b538b
2 changed files with 9 additions and 1 deletions
|
|
@ -6,7 +6,7 @@ set -e
|
||||||
|
|
||||||
echo "Install the dependencies of the vigil script..."
|
echo "Install the dependencies of the vigil script..."
|
||||||
sudo apt-get --yes install python3-minimal python3-pygments python3-pyinotify \
|
sudo apt-get --yes install python3-minimal python3-pygments python3-pyinotify \
|
||||||
python3-urwid
|
python3-urwid python3-psutil
|
||||||
echo
|
echo
|
||||||
echo "Install all the tools vigil may need..."
|
echo "Install all the tools vigil may need..."
|
||||||
./install-tools
|
./install-tools
|
||||||
|
|
|
||||||
8
vigil
8
vigil
|
|
@ -55,6 +55,7 @@ import threading
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
|
import psutil
|
||||||
import pyinotify
|
import pyinotify
|
||||||
|
|
||||||
import fill3
|
import fill3
|
||||||
|
|
@ -136,6 +137,12 @@ def status_to_str(status, is_status_simple):
|
||||||
return status
|
return status
|
||||||
|
|
||||||
|
|
||||||
|
def make_process_nicest(pid):
|
||||||
|
process = psutil.Process(pid)
|
||||||
|
process.set_nice(19)
|
||||||
|
process.set_ionice(psutil.IOPRIO_CLASS_IDLE)
|
||||||
|
|
||||||
|
|
||||||
class Result:
|
class Result:
|
||||||
|
|
||||||
def __init__(self, path, tool, is_stored_compressed=True):
|
def __init__(self, path, tool, is_stored_compressed=True):
|
||||||
|
|
@ -186,6 +193,7 @@ class Result:
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
self.process = multiprocessing_process(
|
self.process = multiprocessing_process(
|
||||||
tools.run_tool_no_error, self.path, self.tool)
|
tools.run_tool_no_error, self.path, self.tool)
|
||||||
|
make_process_nicest(self.process.pid)
|
||||||
new_status, result = self.process.result_conn.recv()
|
new_status, result = self.process.result_conn.recv()
|
||||||
self.status, self.result = new_status, result
|
self.status, self.result = new_status, result
|
||||||
self.process = None
|
self.process = None
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue