mirror of https://github.com/openspug/spug
improve uc
parent
93a8340bd2
commit
27868ac32e
|
@ -62,7 +62,8 @@ def _ext1_deploy(req, helper, env):
|
||||||
extend = req.deploy.extend_obj
|
extend = req.deploy.extend_obj
|
||||||
env.update(SPUG_DST_DIR=extend.dst_dir)
|
env.update(SPUG_DST_DIR=extend.dst_dir)
|
||||||
threads, latest_exception = [], None
|
threads, latest_exception = [], None
|
||||||
with futures.ThreadPoolExecutor(max_workers=min(10, os.cpu_count() + 5)) as executor:
|
max_workers = min(10, os.cpu_count() * 4) if req.deploy.is_parallel else 1
|
||||||
|
with futures.ThreadPoolExecutor(max_workers=max_workers) as executor:
|
||||||
for h_id in json.loads(req.host_ids):
|
for h_id in json.loads(req.host_ids):
|
||||||
env = AttrDict(env.items())
|
env = AttrDict(env.items())
|
||||||
t = executor.submit(_deploy_ext1_host, req, helper, h_id, env)
|
t = executor.submit(_deploy_ext1_host, req, helper, h_id, env)
|
||||||
|
|
|
@ -247,7 +247,7 @@ def post_request_1(request):
|
||||||
form.version = repository.version
|
form.version = repository.version
|
||||||
form.spug_version = repository.spug_version
|
form.spug_version = repository.spug_version
|
||||||
form.deploy_id = repository.deploy_id
|
form.deploy_id = repository.deploy_id
|
||||||
form.host_ids = json.dumps(form.host_ids)
|
form.host_ids = json.dumps(sorted(form.host_ids))
|
||||||
if form.id:
|
if form.id:
|
||||||
req = DeployRequest.objects.get(pk=form.id)
|
req = DeployRequest.objects.get(pk=form.id)
|
||||||
is_required_notify = repository.deploy.is_audit and req.status == '-1'
|
is_required_notify = repository.deploy.is_audit and req.status == '-1'
|
||||||
|
|
Loading…
Reference in New Issue