mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 03:39:25 +02:00
More efficient SQL query to compute import batch status
This commit is contained in:
parent
e29cfb7301
commit
d98c33e5ed
2 changed files with 5 additions and 2 deletions
|
@ -507,6 +507,8 @@ class ImportBatch(models.Model):
|
|||
def update_status(self):
|
||||
old_status = self.status
|
||||
self.status = utils.compute_status(self.jobs.all())
|
||||
if self.status == old_status:
|
||||
return
|
||||
self.save(update_fields=['status'])
|
||||
if self.status != old_status and self.status == 'finished':
|
||||
from . import tasks
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue