Skip to content

Commit 46452ee

Browse files
committed
chore(deploy): add apply tasks
1 parent 0998f3f commit 46452ee

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

rootfs/api/settings/production.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,9 @@
300300

301301
IMAGE_PULL_POLICY = os.environ.get('IMAGE_PULL_POLICY', "IfNotPresent")
302302

303+
# apply task size
304+
DRYCC_APPLY_TASKS = int(os.environ.get('DRYCC_APPLY_TASKS', '20'))
305+
303306
# Drycc filer image
304307
# Provide get and put operations for `drycc volumes:client`
305308
DRYCC_FILER_IMAGE = os.environ.get('DRYCC_FILER_IMAGE', 'registry.drycc.cc/drycc/filer:canary')

rootfs/api/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import jsonschema
1919
from copy import deepcopy
2020
from django.db import models
21+
from django.conf import settings
2122
from django.core.cache import cache
2223
from asgiref.sync import sync_to_async
2324
from requests_toolbelt import user_agent
@@ -159,7 +160,7 @@ def apply_tasks(tasks):
159160
if not tasks:
160161
return
161162

162-
executor = concurrent.futures.ThreadPoolExecutor(5)
163+
executor = concurrent.futures.ThreadPoolExecutor(settings.DRYCC_APPLY_TASKS)
163164
for future, callback in [(executor.submit(task[0]), task[1]) for task in tasks]:
164165
future.add_done_callback(callback)
165166
error = future.exception()

0 commit comments

Comments
 (0)