Skip to content

Commit

Permalink
add task for django clean commands
Browse files Browse the repository at this point in the history
  • Loading branch information
luisza committed Apr 13, 2024
1 parent c83dcf1 commit 4c07d29
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/presentation/tasks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from django.conf import settings
import importlib
from django.core.management import call_command
app = importlib.import_module(settings.CELERY_MODULE).app

@app.task()
def clean_session():
call_command('clearsessions')

@app.task()
def remove_stale_contenttypes():
call_command('remove_stale_contenttypes')

@app.task()
def delete_expired_uploads():
call_command('delete_expired_uploads')

0 comments on commit 4c07d29

Please sign in to comment.