telegram_bots/feeds/management/commands/periodic_feeds.py

21 lines
499 B
Python
Raw Normal View History

2019-11-25 19:42:20 +00:00
import traceback
from time import sleep
import sentry_sdk
from django.core.management import BaseCommand
from feeds.tasks import check_feeds
class Command(BaseCommand):
def handle(self, *args, **options):
while True:
try:
check_feeds.apply_async()
except KeyboardInterrupt:
return
except Exception as e:
sentry_sdk.capture_exception(e)
traceback.print_exc()
sleep(10*60)