add mange command to restart encodes after crash or ctl restart
This commit is contained in:
parent
fb32ec7d96
commit
e084766e69
1 changed files with 22 additions and 0 deletions
22
pandora/archive/management/commands/continue_encoding.py
Normal file
22
pandora/archive/management/commands/continue_encoding.py
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# vi:si:et:sw=4:sts=4:ts=4
|
||||||
|
from optparse import make_option
|
||||||
|
|
||||||
|
from django.core.management.base import BaseCommand
|
||||||
|
|
||||||
|
import app.monkey_patch
|
||||||
|
from ... import models
|
||||||
|
|
||||||
|
|
||||||
|
class Command(BaseCommand):
|
||||||
|
"""
|
||||||
|
"""
|
||||||
|
help = 'reinject files into encoding queue'
|
||||||
|
args = ''
|
||||||
|
|
||||||
|
def handle(self, **options):
|
||||||
|
for f in models.File.objects.filter(encoding=True):
|
||||||
|
if f.streams.all().count():
|
||||||
|
f.process_stream()
|
||||||
|
elif f.data:
|
||||||
|
f.extract_stream()
|
Loading…
Reference in a new issue