From c99cab71cda4825831d63f60a400c1a92c447ad0 Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 19 Jun 2012 10:12:33 +0200 Subject: [PATCH] Use a non-zero exitcode on errors in scripts When a worker can't connect to Redis, return a non-zero exit code so supervisor processes can act accordingly. --- rq/scripts/rqinfo.py | 1 + rq/scripts/rqworker.py | 1 + 2 files changed, 2 insertions(+) diff --git a/rq/scripts/rqinfo.py b/rq/scripts/rqinfo.py index 71c302c..0782cd3 100755 --- a/rq/scripts/rqinfo.py +++ b/rq/scripts/rqinfo.py @@ -174,3 +174,4 @@ def main(): interval(args.interval, func, args) except ConnectionError as e: print(e) + sys.exit(1) diff --git a/rq/scripts/rqworker.py b/rq/scripts/rqworker.py index 06c3a7c..8adc65c 100755 --- a/rq/scripts/rqworker.py +++ b/rq/scripts/rqworker.py @@ -66,3 +66,4 @@ def main(): w.work(burst=args.burst) except ConnectionError as e: print(e) + sys.exit(1)