
5 Dec
2015
5 Dec
'15
9:21 p.m.
From: Paulo Vital <pvital@linux.vnet.ibm.com> The task_id, used to store the AsyncTasks on objectstore, is a global variable. This patch creates a simple method to return the value of this variable. Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com> --- src/wok/utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wok/utils.py b/src/wok/utils.py index 74c521f..8c8973a 100644 --- a/src/wok/utils.py +++ b/src/wok/utils.py @@ -48,6 +48,11 @@ def get_next_task_id(): return task_id +def get_task_id(): + global task_id + return task_id + + def add_task(target_uri, fn, objstore, opaque=None): id = get_next_task_id() AsyncTask(id, target_uri, fn, objstore, opaque) -- 2.5.0