diff options
author | Frederick Muriuki Muriithi | 2022-05-24 05:28:35 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-05-24 05:28:35 +0300 |
commit | bbc4b165761b359115fd1a249ea22e64d55db384 (patch) | |
tree | 421c584118ba0f06a57007954aaf71fde84c4000 /sheepdog | |
parent | 36f8421a8fe223189ab88ee1df3923719ffa4fc0 (diff) | |
download | genenetwork3-bbc4b165761b359115fd1a249ea22e64d55db384.tar.gz |
Fix some linting issues
Diffstat (limited to 'sheepdog')
-rw-r--r-- | sheepdog/worker.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sheepdog/worker.py b/sheepdog/worker.py index 0209699..6557ab3 100644 --- a/sheepdog/worker.py +++ b/sheepdog/worker.py @@ -2,8 +2,9 @@ import os import sys import time -import redis import argparse + +import redis import redis.connection # Enable importing from one dir up: put as first to override any other globally @@ -28,9 +29,7 @@ def make_incremental_backoff(init_val: float=0.1, maximum: int=420): return current if command == "increment": - current = current + abs(value) - if current > maximum: - current = maximum + current = min(current + abs(value), maximum) return current return current @@ -54,8 +53,10 @@ def run_jobs(conn, queue_name: str = "GN3::job-queue"): else: update_status(conn, cmd_id, "error") return cmd_id + return None def parse_cli_arguments(): + """Parse the command-line arguments.""" parser = argparse.ArgumentParser( description="Run asynchronous (service) commands.") parser.add_argument( |