Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions capio-run/capiorun
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,6 @@ if __name__ == "__main__":
),
],
env=server_env,
stdout="server.log",
stderr="server.err",
cwd=args.log_dir,
start_new_session=True,
)
Expand Down Expand Up @@ -198,23 +196,24 @@ if __name__ == "__main__":
f"An error occurred in startup/execution of workflow app <{args.app_name}>: {e}"
)

num_server_files = 6
if server_process is not None:
if count_files_starting_with(workflow_name) >= 4:
if count_files_starting_with(workflow_name) >= num_server_files:
print(
"Server instance is used by other applications... skipping server termination"
)
else:
print(f"Terminating instance of capio_server")
server_process.send_signal(signal.SIGTERM)
server_process.send_signal(signal.SIGUSR1)
time.sleep(2)
print("Terminated CAPIO server instance")
else:
if count_files_starting_with(workflow_name) < 4:
if count_files_starting_with(workflow_name) < num_server_files:
print(
"Terminating instance of capio_server started by other capiorun command"
)
result = subprocess.run(
["killall", "capio_server"], stdout=sys.stdout, stderr=sys.stderr
["killall","-USR1", "capio_server"], stdout=sys.stdout, stderr=sys.stderr
)
if result.returncode == 0:
print("Terminated CAPIO server instance")
Expand Down
Loading