summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof A. Adamski <krzysztofa@gmail.com>2008-06-22 12:02:44 -0400
committerKrzysztof A. Adamski <krzysztofa@gmail.com>2008-06-22 12:02:44 -0400
commita05f793ce3b3fb8f938ea581f51eadf9c4dcdae1 (patch)
treea671bb7d930d6f06d267394086b8495e373bca2d
parent3750980ea547c73a63cb456a85be0b14cc36c30c (diff)
downloadthird_party-func-a05f793ce3b3fb8f938ea581f51eadf9c4dcdae1.tar.gz
third_party-func-a05f793ce3b3fb8f938ea581f51eadf9c4dcdae1.tar.xz
third_party-func-a05f793ce3b3fb8f938ea581f51eadf9c4dcdae1.zip
Change job_id from double to string. Use pprint to get better precision.
-rw-r--r--func/jobthing.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/func/jobthing.py b/func/jobthing.py
index a190dff..c6c616a 100644
--- a/func/jobthing.py
+++ b/func/jobthing.py
@@ -23,6 +23,7 @@ import sys
import fcntl
import forkbomb
import utils
+import pprint
JOB_ID_RUNNING = 0
JOB_ID_FINISHED = 1
@@ -110,7 +111,7 @@ def batch_run(pool, callback, nforks):
operation will be created in cachedir and subsequently deleted.
"""
- job_id = time.time()
+ job_id = pprint.pformat(time.time())
pid = os.fork()
if pid != 0:
__update_status(job_id, JOB_ID_RUNNING, -1)
@@ -132,7 +133,7 @@ def minion_async_run(retriever, method, args):
# minion jobs contain the string "minion".
- job_id = "%s-minion" % time.time()
+ job_id = "%s-minion" % pprint.pformat(time.time())
__update_status(job_id, JOB_ID_RUNNING, -1)
pid = os.fork()
if pid != 0: