File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 300300
301301IMAGE_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`
305308DRYCC_FILER_IMAGE = os .environ .get ('DRYCC_FILER_IMAGE' , 'registry.drycc.cc/drycc/filer:canary' )
Original file line number Diff line number Diff line change 1818import jsonschema
1919from copy import deepcopy
2020from django .db import models
21+ from django .conf import settings
2122from django .core .cache import cache
2223from asgiref .sync import sync_to_async
2324from 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 ()
You can’t perform that action at this time.
0 commit comments