Skip to content
Browse files

bugfix + refactoring: mlog sometimes doesn't print even if the effect…

…ive split is 1
  • Loading branch information...
1 parent b506bb6 commit 2d6bca4de9d0d930b3b8603877d48a8dc5e8f5da @lirazsiri lirazsiri committed Dec 19, 2012
Showing with 8 additions and 5 deletions.
  1. +3 −1 cloudtask/executor.py
  2. +1 −1 cloudtask/session.py
  3. +4 −3 cloudtask/task.py
View
4 cloudtask/executor.py
@@ -303,8 +303,10 @@ class CloudExecutor:
class Error(Exception):
pass
- def __init__(self, split, session, taskconf):
+ def __init__(self, session, taskconf):
ipaddresses = taskconf.workers
+
+ split = taskconf.split
if split == 1:
split = False
View
2 cloudtask/session.py
@@ -227,7 +227,7 @@ def wlog(self):
return self._wlog
makedirs(self.paths.workers)
- wlog = self.WorkerLog(self.paths.workers, False if self.taskconf.split else True)
+ wlog = self.WorkerLog(self.paths.workers, False if self.taskconf.split and self.taskconf.split > 1 else True)
self._wlog = wlog
return wlog
View
7 cloudtask/task.py
@@ -338,9 +338,10 @@ def main(cls):
if not session:
session = Session(opt_sessions)
+ taskconf.split = split
session.taskconf = taskconf
- ok = cls.work(jobs, split, session, taskconf)
+ ok = cls.work(jobs, session, taskconf)
if reporter:
reporter.report(session)
@@ -349,7 +350,7 @@ def main(cls):
sys.exit(1)
@classmethod
- def work(cls, jobs, split, session, taskconf):
+ def work(cls, jobs, session, taskconf):
def status(msg):
timestamp = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())
@@ -378,7 +379,7 @@ def terminate(sig, f):
work_started = time.time()
try:
- executor = CloudExecutor(split, session, taskconf)
+ executor = CloudExecutor(session, taskconf)
for job in jobs:
executor(job)

0 comments on commit 2d6bca4

Please sign in to comment.
Something went wrong with that request. Please try again.