forked from 0x2620/pandora
remove error log entries after 30 days
This commit is contained in:
parent
3f2ba727bd
commit
039f8c9335
1 changed files with 16 additions and 0 deletions
16
pandora/log/tasks.py
Normal file
16
pandora/log/tasks.py
Normal 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()
|
Loading…
Reference in a new issue