mirror of
https://github.com/netinvent/npbackup.git
synced 2025-02-24 22:44:04 +08:00
Add kill_childs to GUI
This commit is contained in:
parent
ca62614f8b
commit
14d950427e
1 changed files with 6 additions and 0 deletions
|
@ -21,6 +21,7 @@ import dateutil
|
|||
from time import sleep
|
||||
from ruamel.yaml.comments import CommentedMap
|
||||
import atexit
|
||||
from ofunctions.process import kill_childs
|
||||
from ofunctions.threading import threaded
|
||||
from ofunctions.misc import BytesConverter
|
||||
import PySimpleGUI as sg
|
||||
|
@ -720,6 +721,11 @@ def main_gui(viewer_mode=False):
|
|||
npbackup.common.execution_logs,
|
||||
datetime.utcnow(),
|
||||
)
|
||||
# kill_childs normally would not be necessary, but let's just be foolproof here (kills restic subprocess in all cases)
|
||||
atexit.register(
|
||||
kill_childs,
|
||||
os.getpid(),
|
||||
)
|
||||
try:
|
||||
_main_gui(viewer_mode=viewer_mode)
|
||||
sys.exit(logger.get_worst_logger_level())
|
||||
|
|
Loading…
Reference in a new issue