19 lines
468 B
Python
19 lines
468 B
Python
|
from django.conf import settings
|
||
|
from django.utils import timezone
|
||
|
|
||
|
from fwd_api.models import SubscriptionRequest
|
||
|
from .cron_job import CronJob
|
||
|
from fwd_api.celery_worker.worker import app as celery_app
|
||
|
|
||
|
class FileCleaningWoker(CronJob):
|
||
|
"""Clean old files to save disk space"""
|
||
|
|
||
|
def run(self):
|
||
|
print("-----------")
|
||
|
|
||
|
|
||
|
|
||
|
@celery_app.task(time_limit=5000)
|
||
|
def clean_media():
|
||
|
worker = FileCleaningWoker("file_cleaning_worker")
|
||
|
worker.run()
|