# Server timeout when opening dash with a long process

**URL:** <https://community.plotly.com/t/server-timeout-when-opening-dash-with-a-long-process/66343>\
**Category:** Dash Python\
**Tags:** question\
**Created:** [July 22, 2022, 12:24pm UTC](https://community.plotly.com/t/server-timeout-when-opening-dash-with-a-long-process/66343 "2022-07-22T12:24:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tasoskav](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tasoskav](https://community.plotly.com/u/tasoskav)\
**Post date:** [July 22, 2022, 12:24pm UTC](https://community.plotly.com/t/server-timeout-when-opening-dash-with-a-long-process/66343/1 "2022-07-22T12:24:40Z")

</div>

I am working on a dashboard with Dash. The problem is that the server has a default timeout of 60 seconds when I start the Dash, but the timeout is not there for callbacks. So, when I calculate everything during Dash initialization, I get the timeout.

When I try to run it like this,

```auto
X_train, y_train, X_test, y_test = titanic_survive()
model = LogisticRegression().fit(X_train, y_train)
explainer = ClassifierExplainer(model, X_test, y_test)
db = ExplainerDashboard(explainer, shap_interaction=False)
db.explainer_layout.register_callbacks(app)   
app.layout = db.explainer_layout.layout()

```

I get the timeout on start up. I thought, I might load the Dash with a landing page and put the computations into a button click.

```auto
app.layout = html.Div([
    html.Button('Submit', id='submit', n_clicks=0),
    html.Div(id='container-button-basic', children='')
])

X_train, y_train, X_test, y_test = titanic_survive()
model = LogisticRegression().fit(X_train, y_train)
explainer = ClassifierExplainer(model, X_test, y_test)

@app.callback(
    Output('container-button-basic', 'children'),
    Input('submit', 'n_clicks'),
)
def update_output(n_clicks):

    if n_clicks == 1:
        db = ExplainerDashboard(explainer, shap_interaction=False) 
        db.explainer_layout.register_callbacks(app)     
        return db.explainer_layout.layout()

```

However, when I do it like this, the “db.explainer\_layout.register\_callbacks(app)” doesn’t seem to work. I get the dashboard but it looks the register callback doesn’t work and all the plots are empty.

The ExplainerDashboard is a Python package [explainerdashboard — explainerdashboard 0.2 documentation](https://explainerdashboard.readthedocs.io/en/latest/index.html)

I don’t have access to the server since I run this through Dataiku. So, I am not sure how to proceed.
