<s> from __future__ import unicode_literals <EOL> from datetime import timedelta <EOL> import logging <EOL> from django . utils . timezone import now <EOL> from mayan . celery import app <EOL> from . literals import UPLOAD_EXPIRATION_INTERVAL <EOL> from . models import SharedUploadedFile <EOL> logger = logging . getLogger ( __name__ ) <EOL> @ app . task ( ignore_result = True ) <EOL> def task_delete_stale_uploads ( ) : <EOL> logger . info ( '<STR_LIT>' ) <EOL> for expired_upload in SharedUploadedFile . objects . filter ( datetime__lt = now ( ) - timedelta ( seconds = UPLOAD_EXPIRATION_INTERVAL ) ) : <EOL> expired_upload . delete ( ) <EOL> logger . info ( '<STR_LIT>' ) </s>
