add mange command to restart encodes after crash or ctl restart

This commit is contained in:
j 2014-11-09 14:10:51 +00:00
parent fb32ec7d96
commit e084766e69

View 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()