1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-06 05:12:21 +01:00

Add core config option to limit compile process count (#3952)

This commit is contained in:
Jesse Hills
2022-10-27 12:17:21 +13:00
committed by GitHub
parent 991fc54994
commit 85faecb2fd
3 changed files with 11 additions and 2 deletions

View File

@@ -8,7 +8,7 @@ import os
import re
import subprocess
from esphome.const import KEY_CORE
from esphome.const import CONF_COMPILE_PROCESS_LIMIT, CONF_ESPHOME, KEY_CORE
from esphome.core import CORE, EsphomeError
from esphome.util import run_external_command, run_external_process
@@ -103,7 +103,10 @@ def run_platformio_cli_run(config, verbose, *args, **kwargs) -> Union[str, int]:
def run_compile(config, verbose):
return run_platformio_cli_run(config, verbose)
args = []
if CONF_COMPILE_PROCESS_LIMIT in config[CONF_ESPHOME]:
args += [f"-j{config[CONF_ESPHOME][CONF_COMPILE_PROCESS_LIMIT]}"]
return run_platformio_cli_run(config, verbose, *args)
def _run_idedata(config):