From 284b8e5d3ba7bff41bf0a1d70919d9abca3d2141 Mon Sep 17 00:00:00 2001 From: Lurkars Date: Sun, 13 Feb 2022 12:09:17 +0100 Subject: [PATCH] fix restart --- application/luniebox.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/luniebox.py b/application/luniebox.py index 8f92a65..b48a53e 100644 --- a/application/luniebox.py +++ b/application/luniebox.py @@ -130,6 +130,7 @@ class Luniebox(object): if restart: subprocess.run(["sudo", "systemctl", "restart", "spotifyd"]) + time.sleep(20) tries = 0 spotifyd_status = subprocess.call( @@ -137,7 +138,7 @@ class Luniebox(object): while spotifyd_status != 0 and tries < max_tries: subprocess.call(["systemctl", "restart", "spotifyd"]) - tries += 1 + tries = tries + 1 time.sleep(10 * tries) spotifyd_status = subprocess.call( ["systemctl", "is-active", "--quiet", "spotifyd"])