Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

refactored away session.elapsed property (moved logic to Task.work)

  • Loading branch information...
commit b506bb6f1a34b98d3061cd3de1e2554031303faa 1 parent 3b6ea89
@lirazsiri lirazsiri authored
Showing with 4 additions and 6 deletions.
  1. +0 −5 cloudtask/session.py
  2. +4 −1 cloudtask/task.py
View
5 cloudtask/session.py
@@ -206,7 +206,6 @@ def __init__(self, sessions_path, id=None):
self._wlog = None
self._mlog = None
- self.started = time.time()
self.key = TempSessionKey()
self.id = id
@@ -223,10 +222,6 @@ def taskconf(self, val=UNDEFINED):
taskconf = property(taskconf, taskconf)
@property
- def elapsed(self):
- return time.time() - self.started
-
- @property
def wlog(self):
if self._wlog:
return self._wlog
View
5 cloudtask/task.py
@@ -375,6 +375,8 @@ def terminate(sig, f):
executor = None
+ work_started = time.time()
+
try:
executor = CloudExecutor(split, session, taskconf)
for job in jobs:
@@ -412,8 +414,9 @@ def terminate(sig, f):
total = len(session.jobs.finished) + len(session.jobs.pending)
print >> session.mlog
+
status("(%d seconds): %d/%d !OK - %d pending, %d timeouts, %d errors, %d OK" % \
- (session.elapsed, total - succeeded, total, len(session.jobs.pending), timeouts, errors, succeeded))
+ (time.time() - work_started, total - succeeded, total, len(session.jobs.pending), timeouts, errors, succeeded))
ok = (total - succeeded == 0)
return ok
Please sign in to comment.
Something went wrong with that request. Please try again.