WikiChron icon indicating copy to clipboard operation
WikiChron copied to clipboard

Find out why the app is restarted every first launch in debug mode

Open Akronix opened this issue 7 years ago • 3 comments
trafficstars

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.

Akronix avatar Oct 03 '18 16:10 Akronix

With other simpler Dash apps it doesn't happen.

Akronix avatar Oct 03 '18 16:10 Akronix

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.

Akronix avatar Oct 04 '18 16:10 Akronix

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.

Akronix avatar Apr 18 '19 18:04 Akronix