mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-07 21:58:11 +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()
|
broker = get_broker()
|
||||||
close_old_django_connections()
|
close_old_django_connections()
|
||||||
try:
|
try:
|
||||||
with db.transaction.atomic():
|
with db.transaction.atomic(using=Schedule.objects.db):
|
||||||
for s in (
|
for s in (
|
||||||
Schedule.objects.select_for_update()
|
Schedule.objects.select_for_update()
|
||||||
.exclude(repeats=0)
|
.exclude(repeats=0)
|
||||||
|
|||||||
Reference in New Issue
Block a user