From cca0541cfa205712fb0a19fb5699d6f54fd2d334 Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Fri, 21 Jun 2024 09:20:19 +0800 Subject: [PATCH] systemd: CPUUsageNSec may not be set with systemd v256 https://github.com/systemd/systemd/pull/33258 --- lilac2/systemd.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lilac2/systemd.py b/lilac2/systemd.py index c940c38..0691ddc 100644 --- a/lilac2/systemd.py +++ b/lilac2/systemd.py @@ -138,7 +138,11 @@ def poll_rusage(name: str, deadline: float) -> tuple[RUsage, bool]: for l in out.splitlines(): k, v = l.split('=', 1) if k == 'CPUUsageNSec': - nsec = int(v) + try: + nsec = int(v) + except ValueError: + # [not set] + pass finally: logger.debug('stopping worker service')