mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-02 16:48:12 +08:00
Add unit test for sync=True change.
When sync=True, re-raise exceptions from the worker.
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
from time import sleep
|
||||
|
||||
|
||||
class TaskError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def countdown(n):
|
||||
while n > 0:
|
||||
n -= 1
|
||||
@@ -44,3 +48,7 @@ def hello():
|
||||
|
||||
def result(obj):
|
||||
print(f"RESULT HOOK {obj.name} : {obj.result()}")
|
||||
|
||||
|
||||
def raise_exception():
|
||||
raise TaskError("this is an exception!")
|
||||
|
||||
Reference in New Issue
Block a user