Black Lives Matter. Please consider donating to Black Girls Code today.

Find if dash is up

is there any way for the client to know if the dash app is still running - without refreshing the page?

I tried using this code - but it doesn’t seem to work and change the color after I bring the app down:

def isOpen(ip,port):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((ip, int(port)))
return True
return False
@app.callback(Output(‘title’, ‘style’),
[Input(‘interval-component’, ‘n_intervals’)],
[State(‘title’, ‘children’)])
def update_style(n,current_state):
if n>0:
if not(n%3):
if isOpen(‘’,8050):
return current_state
return {‘color’: ‘red’}
return current_state
return {‘color’: ‘black’}

When I check the port from another python console - the function do show true/false when the app is up/down

Use hot-reload, when it fails to reload it will send you an alert.

Thanks, but this does not help me. I would like to present a message on the client side - that the app is not working.