2010-08-31 22:00:46 -04:00
|
|
|
from django.core.management.base import BaseCommand
|
|
|
|
from django.conf import settings
|
2015-07-23 16:29:47 -07:00
|
|
|
from apps.rss_feeds.tasks import TaskFeeds, TaskBrokenFeeds
|
2010-08-31 22:00:46 -04:00
|
|
|
import datetime
|
|
|
|
|
|
|
|
|
|
|
|
class Command(BaseCommand):
|
|
|
|
|
2020-06-08 07:55:17 -04:00
|
|
|
def add_arguments(self, parser):
|
|
|
|
parser.add_argument("-f", "--feed", default=None)
|
|
|
|
parser.add_argument("-a", "--all", default=False, action='store_true')
|
|
|
|
parser.add_argument("-b", "--broken", help="Task broken feeds that havent been fetched in a day.", default=False, action='store_true')
|
|
|
|
parser.add_argument('-V', '--verbose', action='store_true',
|
|
|
|
dest='verbose', default=False, help='Verbose output.')
|
|
|
|
|
2010-08-31 22:00:46 -04:00
|
|
|
def handle(self, *args, **options):
|
2015-07-23 16:29:47 -07:00
|
|
|
if options['broken']:
|
2020-10-05 00:45:20 +07:00
|
|
|
TaskBrokenFeeds().apply()
|
2015-07-23 16:29:47 -07:00
|
|
|
else:
|
2020-10-05 00:45:20 +07:00
|
|
|
TaskFeeds().apply()
|