Skip to content

Commit

Permalink
Ensure windows wrapper exits after fatal error
Browse files Browse the repository at this point in the history
  • Loading branch information
theotherp committed Nov 20, 2023
1 parent f4fd23b commit affcbe5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/buildNative.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ jobs:
uses: actions/upload-artifact@master
with:
name: core-windows
path: core/target/core.exe
path: core/target/core.exe
6 changes: 0 additions & 6 deletions .github/workflows/system-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,6 @@ jobs:
find . -name "*.log"
cd ../../..
- name: "Truncate large log files"
if: always()
# If the logs are larger than 1MB there's probably something wrong
run: |
for d in ./**/*.log ; do (truncate --size=1M $d); done
- name: "Upload data folder artifact"
uses: actions/upload-artifact@v3
if: always()
Expand Down
14 changes: 11 additions & 3 deletions other/wrapper/pyInstaller/windows/nzbhydra2wrapperWindows.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3

import logging
# (C) Copyright 2023 TheOtherP (theotherp@posteo.net)
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -16,12 +16,20 @@
# Just for pyinstaller

import sys
import time

import nzbhydra2wrapperPy3
import systemTray

if __name__ == '__main__':
thread = systemTray.start()
nzbhydra2wrapperPy3.quiet = True
nzbhydra2wrapperPy3.main(sys.argv[1:])
systemTray.stop()
try:
nzbhydra2wrapperPy3.main(sys.argv[1:])
systemTray.stop()
except SystemExit as e:
logging.getLogger('root').info("Wrapper main thread quit")
# For some reason thread / process is kept alive without sleeping
time.sleep(1)
systemTray.stop()
sys.exit(e.code)
4 changes: 2 additions & 2 deletions releases/windows-release/include/NZBHydra2.exe
Git LFS file not shown

0 comments on commit affcbe5

Please sign in to comment.