Find out why the app is restarted every first launch in debug mode
Akronix opened this issue · 3 comments
For some reason, the code contained in main:
# create and config Dash instance
app = create_app()
# set layout, import startup js and bind callbacks
set_up_app(app)
# start Dash instance
start_app(app)
is executed twice every time the app is launched.
I'm not sure if this is a expected behaviour and if it's because of Dash or because of our code. This is what we need to find out.
With other simpler Dash apps it doesn't happen.
Apparently, the app is restarted in debug mode by this trigger:
* Restarting with stat
which I don't know why is being triggered, are we modifying any file when the app starts? I don't think so and if it were transcendental, then it would be seen in production, where the app doesn't restart.
I think it's not restarted, but firstly, the app is launched normally with python and secondly, a parent (master) process launches it as a child in order to restart the child when the filesystem changes.
I'm not sure now if this happens with Flask apps too.