remove error log entries after 30 days

This commit is contained in:
j 2013-01-12 08:20:22 +00:00
parent 3f2ba727bd
commit 039f8c9335

16
pandora/log/tasks.py Normal file
View file

@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
import os
from datetime import timedelta, datetime
import gzip
import random
random
from django.conf import settings
from celery.task import task, periodic_task
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()