File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 33
44import logging
55import os
6+ import time
67from logging import handlers
78from shlex import join
89from subprocess import check_call
@@ -68,20 +69,18 @@ def initialized():
6869 logger .info ("Starting Huey consumer..." )
6970 logger .info (f"Cache directory = { CACHE_DIR } " )
7071
71-
7272@huey .task (priority = 10 )
7373def pio_run (* args : str , env : dict [str , str ] = {}) -> bool :
7474 # for long running pio run jobs where we don't care about the output / status
75- command = ("nohup" , PIO_EXECUTABLE , "run" ) + args
7675
76+ unique_id = f"pio-stirring-{ int (time .time ())} " # Ensure a unique unit name
7777 command = (
7878 "systemd-run" ,
79- "--scope" ,
80- "--user" , # optional: run as a user unit
81- "-p" ,
82- "KillSignal=SIGTERM" ,
83- "-p" ,
84- "TimeoutStopSec=30" ,
79+ "--unit" ,
80+ unique_id , # Assigns a unique systemd unit name
81+ "--user" , # Runs under the user instance of systemd
82+ "--property=KillSignal=SIGTERM" ,
83+ "--property=TimeoutStopSec=30" ,
8584 PIO_EXECUTABLE ,
8685 "run" ,
8786 ) + args
You can’t perform that action at this time.
0 commit comments