From 32ffe5e2d76bfcd05f2ccb48e805e2cad236a84a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez?= Date: Tue, 15 Oct 2013 07:57:18 +0000 Subject: [PATCH] Fixed DelayedTask Class to include new "register" member from trunk --- server/src/uds/core/jobs/DelayedTask.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/src/uds/core/jobs/DelayedTask.py b/server/src/uds/core/jobs/DelayedTask.py index 1e371347..d58aa8c7 100644 --- a/server/src/uds/core/jobs/DelayedTask.py +++ b/server/src/uds/core/jobs/DelayedTask.py @@ -55,3 +55,14 @@ class DelayedTask(Environmentable): You must provide your own "run" method to do whatever you need ''' logging.debug("Base run of job called for class") + + def register(self, suggestedTime, tag='', check=True): + ''' + Utility method that allows to register a Delayedtask + ''' + from DelayedTaskRunner import DelayedTaskRunner + + if check is True and DelayedTaskRunner.runner().checkExists(tag): + return + + DelayedTaskRunner.runner().insert(self, suggestedTime, tag)