Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Akronix opened this issue Oct 3, 2018 · 3 comments
Open
Labels

Comments

@Akronix
Copy link
Collaborator

Akronix commented Oct 3, 2018

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
Copy link
Collaborator Author

Akronix commented Oct 3, 2018

With other simpler Dash apps it doesn't happen.

@Akronix
Copy link
Collaborator Author

Akronix commented Oct 4, 2018

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 Akronix changed the title Find out why the __main__ code is always executed twice Find out why the app is restarted every first launch in debug mode Oct 4, 2018
@Akronix
Copy link
Collaborator Author

Akronix commented Apr 18, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant