Skip to content

Commit ec2c03a

Browse files
author
Sarah Krebs
committed
Free port when exiting via the exit button
1 parent 4b0b7eb commit ec2c03a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
- When getting budget, objectives etc from multiple runs in Cost over Time and Pareto Front:
2929
- Instead of taking the first run as comparative value,
3030
- take the one with the lowest budget, else the index for the budgets could be out of bounds.
31+
- Free port when exiting via the exit button (#52).
3132

3233
## Documentation
3334
- Add How to Contribute section.

deepcave/layouts/header.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
import time
1818

1919
import dash_bootstrap_components as dbc
20+
import requests
2021
from dash import dcc, html
2122
from dash.dependencies import Input, Output
2223

23-
from deepcave import app, c, queue
24+
from deepcave import app, c, config, queue
2425
from deepcave.layouts import Layout
2526

2627

@@ -114,6 +115,7 @@ def callback(n_clicks: Optional[int]) -> None:
114115
# Then we want to terminate DeepCAVE
115116
if n_clicks is not None:
116117
time.sleep(1)
118+
requests.post(f"http://localhost:{config.DASH_PORT}/shutdown")
117119
os._exit(130)
118120

119121
def __call__(self) -> html.Header: # noqa: D102

0 commit comments

Comments
 (0)