Skip to content

Commit

Permalink
utils: log envvar SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT when invalid
Browse files Browse the repository at this point in the history
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
  • Loading branch information
mr-cal committed Feb 23, 2023
1 parent ce9c24e commit 5489261
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions snapcraft/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,12 @@ def get_parallel_build_count() -> int:
build_count = 1

try:
max_count = int(os.environ.get("SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT", ""))
max_count_env = os.environ.get("SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT", "")
max_count = int(max_count_env)
if max_count > 0:
build_count = min(build_count, max_count)
except ValueError:
emit.debug("Invalid SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT value")
emit.debug(f"Invalid SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT {max_count_env!r}")

return build_count

Expand Down

0 comments on commit 5489261

Please sign in to comment.