Skip to content

Commit a2d4a53

Browse files
committed
Fix error when using --trace_greenlets in some cases. Tag as 0.1.5
1 parent 5342e6d commit a2d4a53

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

mrq/job.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,11 @@ def save_status(
207207
updates["queue"] = queue
208208
if get_current_config().get("trace_greenlets"):
209209
current_greenlet = gevent.getcurrent()
210-
updates["time"] = current_greenlet._trace_time
211-
updates["switches"] = current_greenlet._trace_switches
210+
211+
# TODO are we sure the current job is doing the save_status() on itself?
212+
if hasattr(current_greenlet, "_trace_time"):
213+
updates["time"] = current_greenlet._trace_time
214+
updates["switches"] = current_greenlet._trace_switches
212215

213216
if exception:
214217
trace = traceback.format_exc()

mrq/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = "0.1.4"
1+
VERSION = "0.1.5"

0 commit comments

Comments
 (0)