From 9227eef1fb1b952fb9ffbca1a4af6071d3d4f7ac Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 15 Jan 2010 20:04:39 +0000 Subject: [PATCH] it's now possible to run a single task more than once inside a given script. No need to instantiate each task before calling start() git-svn-id: svn://svn.open-ils.org/ILS-Contrib/constrictor/trunk@759 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- constrictor/task.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/constrictor/task.py b/constrictor/task.py index 6356d0672..7c32818d1 100644 --- a/constrictor/task.py +++ b/constrictor/task.py @@ -30,6 +30,9 @@ class Task(object): def __init__(self, name=''): self.name = name + self.reset() + + def reset(self): self.duration = 0 self.success = False self.complete = False @@ -40,6 +43,7 @@ class Task(object): def start(self, **kwargs): + self.reset() ret = None # capture the return value from the task start = time.time() -- 2.43.2