forked from 0x2620/pandora
processing trumps queued
This commit is contained in:
parent
c409b63f25
commit
680efc967c
1 changed files with 4 additions and 3 deletions
|
@ -66,6 +66,7 @@ class Task(models.Model):
|
||||||
task, created = cls.objects.get_or_create(item=item)
|
task, created = cls.objects.get_or_create(item=item)
|
||||||
if task.update(save=False) or created:
|
if task.update(save=False) or created:
|
||||||
task.user = user
|
task.user = user
|
||||||
|
if not task.started:
|
||||||
task.started = datetime.now()
|
task.started = datetime.now()
|
||||||
task.ended = None
|
task.ended = None
|
||||||
task.save()
|
task.save()
|
||||||
|
@ -83,10 +84,10 @@ class Task(models.Model):
|
||||||
status = 'pending'
|
status = 'pending'
|
||||||
elif self.item.files.filter(uploading=True).count():
|
elif self.item.files.filter(uploading=True).count():
|
||||||
status = 'uploading'
|
status = 'uploading'
|
||||||
elif self.item.files.filter(queued=True).count():
|
|
||||||
status = 'queued'
|
|
||||||
elif self.item.files.filter(encoding=True).count():
|
elif self.item.files.filter(encoding=True).count():
|
||||||
status = 'processing'
|
status = 'processing'
|
||||||
|
elif self.item.files.filter(queued=True).count():
|
||||||
|
status = 'queued'
|
||||||
elif self.item.files.filter(failed=True).count():
|
elif self.item.files.filter(failed=True).count():
|
||||||
status = 'failed'
|
status = 'failed'
|
||||||
elif self.item.rendered:
|
elif self.item.rendered:
|
||||||
|
|
Loading…
Reference in a new issue