pandora/pandora/log/tasks.py

11 lines
300 B
Python

# -*- coding: utf-8 -*-
from datetime import timedelta, datetime
from celery.task import periodic_task
from . import models
@periodic_task(run_every=timedelta(days=1), queue='encoding')
def cronjob(**kwargs):
models.Log.objects.filter(modified__lt=datetime.now()-timedelta(days=30)).delete()