Skip to content

Commit 5c602c3

Browse files
author
Whit Morriss
committed
Slight change to make overriding easier
1 parent 171fbe5 commit 5c602c3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pyres/job.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from pyres import failure
44
from pyres.failure.redis import RedisBackend
55

6+
67
class Job(object):
78
"""Every job on the ResQ is an instance of the *Job* class.
89
@@ -21,6 +22,9 @@ class Job(object):
2122
done by that worker. Default is "None".
2223
2324
"""
25+
26+
safe_str_to_class = staticmethod(safe_str_to_class)
27+
2428
def __init__(self, queue, payload, resq, worker=None):
2529
self._queue = queue
2630
self._payload = payload
@@ -39,9 +43,11 @@ def perform(self):
3943
"""This method converts payload into args and calls the ``perform``
4044
method on the payload class.
4145
46+
#@ add entry_point loading
47+
4248
"""
4349
payload_class_str = self._payload["class"]
44-
payload_class = safe_str_to_class(payload_class_str)
50+
payload_class = self.safe_str_to_class(payload_class_str)
4551
payload_class.resq = self.resq
4652
args = self._payload.get("args")
4753

0 commit comments

Comments
 (0)