remove tray filepath if pid is not running

This commit is contained in:
Jakub Trllo 2024-07-24 16:31:10 +02:00
parent 9c01ddaf63
commit a4de305fde

View file

@ -278,7 +278,12 @@ def remove_tray_server_url(force: Optional[bool] = False):
except BaseException:
data = {}
if force or not data or data.get("pid") == os.getpid():
if (
force
or not data
or data.get("pid") == os.getpid()
or not _is_process_running(data.get("pid"))
):
os.remove(filepath)