summaryrefslogtreecommitdiffstats
path: root/gearman/psWorker.py
diff options
context:
space:
mode:
Diffstat (limited to 'gearman/psWorker.py')
-rwxr-xr-xgearman/psWorker.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/gearman/psWorker.py b/gearman/psWorker.py
index db90a66..cc7cdc0 100755
--- a/gearman/psWorker.py
+++ b/gearman/psWorker.py
@@ -32,12 +32,11 @@ def psWorker(worker, job):
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
-
+
while sshCommand.returncode == None:
out = sshCommand.stdout.readline()
if out != "":
ret['rawoutput'] += out
- time.sleep(0.05)
sshCommand.poll()
while True:
@@ -49,11 +48,12 @@ def psWorker(worker, job):
ret['rawoutput'] = ret['rawoutput'].strip() # get rid of newlines
rc = ret['rc'] = sshCommand.returncode
-
if rc == 0:
lines = ret['rawoutput'].splitlines()
ret['ps'] = []
for l in xrange(len(lines)):
+ if l == 0:
+ continue
rowentries = lines[l].split()
if len(rowentries) == 14:
(f, s, uid, pid, ppid, c, pri, ni, addr, sz, wchan, tty, time, cmd) = rowentries