mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-07 17:18:12 +08:00
Don't close DB connection if async_task was called with sync=True (#301)
This commit is contained in:
+2
-1
@@ -85,7 +85,8 @@ def worker(
|
||||
if not callable(f):
|
||||
# locate() returns None if f cannot be loaded
|
||||
f = pydoc.locate(f)
|
||||
close_old_django_connections()
|
||||
if not task.get("sync", False):
|
||||
close_old_django_connections()
|
||||
timer_value = task.pop("timeout", timeout)
|
||||
# signal execution
|
||||
pre_execute.send(sender="django_q", func=f, task=task)
|
||||
|
||||
Reference in New Issue
Block a user