summaryrefslogtreecommitdiff
path: root/rq/utils.py
diff options
context:
space:
mode:
authorRony Lutsky <3050627+ronlut@users.noreply.github.com>2023-03-21 01:44:41 +0200
committerGitHub <noreply@github.com>2023-03-21 06:44:41 +0700
commit04722339d7598ff0c52f11c3680ed2dd922e6768 (patch)
treeae729515eab0d3393201b95475bf26d90c35a27a /rq/utils.py
parent60164c510721c84d9500a25b0f7bd186510cbca0 (diff)
downloadrq-04722339d7598ff0c52f11c3680ed2dd922e6768.tar.gz
Consolidate job callbacks execution (#1851)
* consolidate job failure callback execution * fix * success callback as well * merge fix * create Callback class and change how callbacks serde * deprecation * add tests * string format * pr fix * revert serialization changes * fix timeout typing * add documentation * add test * fix a bug * fix tests * move job heartbeat call to worker and make sure there is always a callback timeout * fix test * fix test
Diffstat (limited to 'rq/utils.py')
-rw-r--r--rq/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/rq/utils.py b/rq/utils.py
index 9cd1255..b10e262 100644
--- a/rq/utils.py
+++ b/rq/utils.py
@@ -349,7 +349,7 @@ def str_to_date(date_str: Optional[str]) -> Union[dt.datetime, Any]:
return utcparse(date_str.decode())
-def parse_timeout(timeout: Any):
+def parse_timeout(timeout: Union[int, float, str]) -> int:
"""Transfer all kinds of timeout format to an integer representing seconds"""
if not isinstance(timeout, numbers.Integral) and timeout is not None:
try: