mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-06 10:38:11 +08:00
Feature/improves multiple databases support (#561)
* feat: adds docker local files to ignore * feat: adds replica key to django q settings * feat: adds multiple database routers testing utility * feat: ensures scheduler works with multiple databases and replicas * feat: adds docker image to support containerized development * refactor: removes unnecessary import * style: improves import styling * docs: adds replica setting to configure documentation
This commit is contained in:
+2
-1
@@ -576,7 +576,8 @@ def scheduler(broker: Broker = None):
|
||||
broker = get_broker()
|
||||
close_old_django_connections()
|
||||
try:
|
||||
with db.transaction.atomic(using=Schedule.objects.db):
|
||||
database_to_use = {"using": Conf.ORM} if not Conf.HAS_REPLICA else {}
|
||||
with db.transaction.atomic(**database_to_use):
|
||||
for s in (
|
||||
Schedule.objects.select_for_update()
|
||||
.exclude(repeats=0)
|
||||
|
||||
Reference in New Issue
Block a user