Make short task time limit configureable

This commit is contained in:
Tobias Perelstein 2023-08-17 00:08:02 -04:00
parent 15d217453b
commit 0d73256de9
3 changed files with 3 additions and 2 deletions

View File

@ -418,6 +418,7 @@ CELERY_TASK_SERIALIZER = "json"
CELERY_RESULT_SERIALIZER = "json" CELERY_RESULT_SERIALIZER = "json"
CELERY_TIMEZONE = TIME_ZONE CELERY_TIMEZONE = TIME_ZONE
CELERY_SOFT_TIME_LIMIT = 2 * 60 * 60 CELERY_SOFT_TIME_LIMIT = 2 * 60 * 60
CELERY_SHORT_SOFT_TIME_LIMIT = 60 * 30
CELERY_WORKER_PREFETCH_MULTIPLIER = 1 CELERY_WORKER_PREFETCH_MULTIPLIER = 1
CELERYD_PREFETCH_MULTIPLIER = 1 CELERYD_PREFETCH_MULTIPLIER = 1

View File

@ -9,4 +9,4 @@ user=www-data
directory=/home/mediacms.io/mediacms directory=/home/mediacms.io/mediacms
priority=400 priority=400
startinorder=true startinorder=true
command=/home/mediacms.io/bin/celery multi start short1 short2 --pidfile=/var/run/mediacms/%%n.pid --loglevel=INFO --logfile=/home/mediacms.io/mediacms/logs/celery_short.log --soft-time-limit=300 -c10 -Q short_tasks command=/home/mediacms.io/bin/celery multi start short1 short2 --pidfile=/var/run/mediacms/%%n.pid --loglevel=INFO --logfile=/home/mediacms.io/mediacms/logs/celery_short.log -c10 -Q short_tasks

View File

@ -48,7 +48,7 @@ ERRORS_LIST = [
] ]
@task(name="chunkize_media", bind=True, queue="short_tasks", soft_time_limit=60 * 30) @task(name="chunkize_media", bind=True, queue="short_tasks", soft_time_limit=settings.CELERY_SHORT_SOFT_TIME_LIMIT)
def chunkize_media(self, friendly_token, profiles, force=True): def chunkize_media(self, friendly_token, profiles, force=True):
"""Break media in chunks and start encoding tasks""" """Break media in chunks and start encoding tasks"""