mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-02-17 15:08:22 +00:00
Merge pull request #165 from yedpodtrzitko/yed/ci-run
ci: try to run the app
This commit is contained in:
@@ -191,6 +191,9 @@ class QtDriver(QObject):
|
||||
)
|
||||
|
||||
max_threads = os.cpu_count()
|
||||
if args.ci:
|
||||
# spawn only single worker in CI environment
|
||||
max_threads = 1
|
||||
for i in range(max_threads):
|
||||
# thread = threading.Thread(target=self.consumer, name=f'ThumbRenderer_{i}',args=(), daemon=True)
|
||||
# thread.start()
|
||||
@@ -234,6 +237,7 @@ class QtDriver(QObject):
|
||||
|
||||
# Handle OS signals
|
||||
self.setup_signals()
|
||||
# allow to process input from console, eg. SIGTERM
|
||||
timer = QTimer()
|
||||
timer.start(500)
|
||||
timer.timeout.connect(lambda: None)
|
||||
@@ -524,7 +528,11 @@ class QtDriver(QObject):
|
||||
)
|
||||
self.open_library(lib)
|
||||
|
||||
app.exec_()
|
||||
if self.args.ci:
|
||||
# gracefully terminate the app in CI environment
|
||||
self.thumb_job_queue.put((self.SIGTERM.emit, []))
|
||||
|
||||
app.exec()
|
||||
|
||||
self.shutdown()
|
||||
|
||||
|
||||
@@ -45,6 +45,11 @@ def main():
|
||||
type=str,
|
||||
help="User interface option for TagStudio. Options: qt, cli (Default: qt)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--ci",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
help="Exit the application after checking it starts without any problem. Meant for CI check.",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
core = TagStudioCore() # The TagStudio Core instance. UI agnostic.
|
||||
|
||||
Reference in New Issue
Block a user