chore: rename server to api (#7342)

This commit is contained in:
sriram veeraghanta 2025-07-04 15:32:21 +05:30 committed by GitHub
parent 6bee97eb26
commit fdbe4c2ca6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
554 changed files with 39 additions and 43 deletions

View file

@ -0,0 +1,25 @@
# Python imports
import os
from datetime import timedelta
# Django imports
from django.utils import timezone
from django.db.models import Q
# Third party imports
from celery import shared_task
# Module imports
from plane.db.models import FileAsset
@shared_task
def delete_unuploaded_file_asset():
"""This task deletes unuploaded file assets older than a certain number of days."""
FileAsset.objects.filter(
Q(
created_at__lt=timezone.now()
- timedelta(days=int(os.environ.get("UNUPLOADED_ASSET_DELETE_DAYS", "7")))
)
& Q(is_uploaded=False)
).delete()