mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-05 03:38:12 +08:00
Close threadpools after use.
This commit is contained in:
@@ -150,8 +150,10 @@ def create_local_repo_from_koji_tag(config, tag, repo_dir, archs=None):
|
||||
|
||||
# Download the RPMs four at a time.
|
||||
pool = ThreadPool(4)
|
||||
pool.map(_download_file, download_args)
|
||||
pool.close()
|
||||
try:
|
||||
pool.map(_download_file, download_args)
|
||||
finally:
|
||||
pool.close()
|
||||
|
||||
# If we downloaded something, run the createrepo_c.
|
||||
if repo_changed:
|
||||
|
||||
@@ -134,7 +134,11 @@ def format_mmd(mmd, scmurl, session=None):
|
||||
# Check that SCM URL is valid and replace potential branches in pkg refs
|
||||
# by real SCM hash and store the result to our private xmd place in modulemd.
|
||||
pool = ThreadPool(20)
|
||||
pkg_dicts = pool.map(_scm_get_latest, mmd.get_rpm_components().values())
|
||||
try:
|
||||
pkg_dicts = pool.map(_scm_get_latest, mmd.get_rpm_components().values())
|
||||
finally:
|
||||
pool.close()
|
||||
|
||||
err_msg = ""
|
||||
for pkg_dict in pkg_dicts:
|
||||
if pkg_dict["error"]:
|
||||
|
||||
Reference in New Issue
Block a user