mirror of
https://github.com/bugsink/bugsink.git
synced 2025-12-30 09:50:11 -06:00
'poor mans's DB lock: lock the right DB
See #252 where the following error was triggered: > django.db.transaction.TransactionManagementError: select_for_update cannot be > used outside of a transaction. I believe that this is caused by using a non-sqlite database for the snappea DB. "You probably shouldn't" but at least our own behavior should be consistent. I haven't been able to reproduce this particular error BTW, but at least I've reproduced _some_ error conditions that this commit fixes.
This commit is contained in:
@@ -172,7 +172,7 @@ class ImmediateAtomic(SuperDurableAtomic):
|
||||
# like very much that we stick closely to the sqlite model for the mysql case, but we can always take this
|
||||
# road later.
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
ContentType.objects.select_for_update().order_by("pk").first()
|
||||
ContentType.objects.using(self.using).select_for_update().order_by("pk").first()
|
||||
|
||||
self.t0 = time.time()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user