Skip to content

Commit

Permalink
feat: make task limit value configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
ericswpark committed Aug 26, 2024
1 parent 965ab13 commit e9e4a25
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docker/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -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 #
Expand Down
4 changes: 4 additions & 0 deletions docs/sysadmin/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion server/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit e9e4a25

Please sign in to comment.