fix lock problems… hopefully

This commit is contained in:
Laura Klünder 2017-12-20 13:13:49 +01:00
parent 27380c86b7
commit da115171d1

View file

@ -78,7 +78,7 @@ class MapUpdate(models.Model):
@contextmanager
def lock(cls):
with transaction.atomic():
yield cls.objects.select_for_update().earliest()
yield cls.objects.select_for_update().get(pk=cls.objects.earliest().pk)
def _changed_geometries_filename(self):
return os.path.join(settings.CACHE_ROOT, 'changed_geometries', 'update_%d.pickle' % self.pk)