mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-24 00:48:12 +08:00
Lock the Scheduler model for the database it's using
This can happen when you use a database router for example
This commit is contained in:
+1
-1
@@ -546,7 +546,7 @@ def scheduler(broker=None):
|
||||
broker = get_broker()
|
||||
close_old_django_connections()
|
||||
try:
|
||||
with db.transaction.atomic():
|
||||
with db.transaction.atomic(using=Schedule.objects.db):
|
||||
for s in (
|
||||
Schedule.objects.select_for_update()
|
||||
.exclude(repeats=0)
|
||||
|
||||
Reference in New Issue
Block a user