From f72ceab69be9658052a9767c95091ae0449f74b7 Mon Sep 17 00:00:00 2001 From: Florian Perucki Date: Wed, 6 Jan 2016 12:52:03 +0100 Subject: [PATCH 1/2] Fixed OverflowError when returning job IDs --- mrq/bin/mrq_run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mrq/bin/mrq_run.py b/mrq/bin/mrq_run.py index 3a9924f7..217f1837 100755 --- a/mrq/bin/mrq_run.py +++ b/mrq/bin/mrq_run.py @@ -58,7 +58,7 @@ def main(): job.datestarted = datetime.datetime.utcnow() set_current_job(job) ret = job.perform() - print json.dumps(ret) # pylint: disable=no-member + print ret # This shouldn't be needed as the process will exit and close any remaining sockets # connections.redis.connection_pool.disconnect() From c75b99a7758c8edcc44da87fcede4355e5fa7c68 Mon Sep 17 00:00:00 2001 From: Florian Perucki Date: Wed, 6 Jan 2016 16:53:51 +0100 Subject: [PATCH 2/2] Use standard json to dump job results --- mrq/bin/mrq_run.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mrq/bin/mrq_run.py b/mrq/bin/mrq_run.py index 217f1837..1cda61ad 100755 --- a/mrq/bin/mrq_run.py +++ b/mrq/bin/mrq_run.py @@ -14,6 +14,7 @@ import sys import argparse import ujson as json +import json as json_stdlib import datetime sys.path.insert(0, os.getcwd()) @@ -21,8 +22,7 @@ from mrq import config, utils from mrq.context import set_current_config, set_current_job, connections from mrq.job import queue_job -from mrq.utils import load_class_by_path - +from mrq.utils import load_class_by_path, MongoJSONEncoder def main(): @@ -58,7 +58,7 @@ def main(): job.datestarted = datetime.datetime.utcnow() set_current_job(job) ret = job.perform() - print ret + print json_stdlib.dumps(ret, cls=MongoJSONEncoder) # pylint: disable=no-member # This shouldn't be needed as the process will exit and close any remaining sockets # connections.redis.connection_pool.disconnect()