diff --git a/docker/example.env b/docker/example.env index 0f7b8137..b0c4da12 100644 --- a/docker/example.env +++ b/docker/example.env @@ -34,6 +34,10 @@ SHIPPER_SESSION_COOKIE_SECURE=1 # Warning: if you set up HSTS but not HTTPS you will be unable to access the instance SHIPPER_SECURE_HSTS_SECONDS=0 +# Task time limit (in minutes) +# Controls the limit of build mirror tasks before they are killed +SHIPPER_TASK_TIME_LIMIT=60 + ########## # Upload # diff --git a/docs/sysadmin/Configuration.md b/docs/sysadmin/Configuration.md index 805c2925..02097e6c 100644 --- a/docs/sysadmin/Configuration.md +++ b/docs/sysadmin/Configuration.md @@ -52,6 +52,10 @@ SHIPPER_OTHER_CONFIG_OPTION=1 # for true - Setting this key to any value other than 0 will enable HSTS for the specified duration (in seconds) - Warning: make sure you know what you are doing! Improper settings may block you from accessing your instance. - Default: `0` + - `SHIPPER_TASK_TIME_LIMIT` + - Controls the limit of build mirror tasks before they are killed + - Setting is in minutes + - Default: `60` ### Upload - `SHIPPER_UPLOAD_CHECKSUM` diff --git a/server/config/settings.py b/server/config/settings.py index 6e47cba8..1d12a6e5 100644 --- a/server/config/settings.py +++ b/server/config/settings.py @@ -284,7 +284,7 @@ # Celery CELERY_BROKER_URL = "pyamqp://rabbitmq:5672/" -CELERY_TASK_TIME_LIMIT = 60 * 60 # 1 hour +CELERY_TASK_TIME_LIMIT = 60 * int(os.environ.get("SHIPPER_TASK_TIME_LIMIT", default=60)) CELERY_TASK_TRACK_STARTED = True CELERY_RESULT_BACKEND = "django-db" CELERY_RESULT_CACHE = "default"