From 768ca2ab2b0efcbf085d3cf36685c4a39b2ff1b5 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 14 Sep 2022 20:06:19 -0700 Subject: [PATCH] updated: remove niceness (#25791) old-commit-hash: 96ef9b1f0c15ecc0695401ca4e5c103d52fb088f --- selfdrive/updated.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/selfdrive/updated.py b/selfdrive/updated.py index 2a36094768..65f8425201 100755 --- a/selfdrive/updated.py +++ b/selfdrive/updated.py @@ -67,9 +67,7 @@ class WaitTimeHelper: self.ready_event.wait(timeout=t) -def run(cmd: List[str], cwd: Optional[str] = None, low_priority: bool = False): - if low_priority: - cmd = ["nice", "-n", "19"] + cmd +def run(cmd: List[str], cwd: Optional[str] = None): return subprocess.check_output(cmd, cwd=cwd, stderr=subprocess.STDOUT, encoding='utf8') @@ -212,7 +210,7 @@ def init_overlay() -> None: run(["sudo"] + mount_cmd) run(["sudo", "chmod", "755", os.path.join(OVERLAY_METADATA, "work")]) - git_diff = run(["git", "diff"], OVERLAY_MERGED, low_priority=True) + git_diff = run(["git", "diff"], OVERLAY_MERGED) params.put("GitDiff", git_diff) cloudlog.info(f"git diff output:\n{git_diff}") @@ -277,7 +275,7 @@ def check_git_fetch_result(fetch_txt: str) -> bool: def check_for_update() -> Tuple[bool, bool]: setup_git_options(OVERLAY_MERGED) try: - git_fetch_output = run(["git", "fetch", "--dry-run"], OVERLAY_MERGED, low_priority=True) + git_fetch_output = run(["git", "fetch", "--dry-run"], OVERLAY_MERGED) return True, check_git_fetch_result(git_fetch_output) except subprocess.CalledProcessError: return False, False @@ -288,7 +286,7 @@ def fetch_update() -> bool: setup_git_options(OVERLAY_MERGED) - git_fetch_output = run(["git", "fetch"], OVERLAY_MERGED, low_priority=True) + git_fetch_output = run(["git", "fetch"], OVERLAY_MERGED) cloudlog.info("git fetch success: %s", git_fetch_output) cur_hash = run(["git", "rev-parse", "HEAD"], OVERLAY_MERGED).rstrip() @@ -315,7 +313,7 @@ def fetch_update() -> bool: if new_branch is not None: cloudlog.info(f"switching to branch {repr(new_branch)}") cmds.insert(0, ["git", "checkout", "-f", new_branch]) - r = [run(cmd, OVERLAY_MERGED, low_priority=True) for cmd in cmds] + r = [run(cmd, OVERLAY_MERGED) for cmd in cmds] cloudlog.info("git reset success: %s", '\n'.join(r)) if AGNOS: