Prevent long_update from initial call (prevent_initial_call not working)

I am trying to add some text that shows if some long call-back is currently executing or has finished. At the moment the “In progress” message is displaying when the page loads up, even though prevent_initial_call is set to true

Here is my callback

@app.long_callback(
output=Output(‘forecast_tag_success’, ‘children’),
inputs=Input(‘Forecast-Data-Button’, ‘n_clicks’),
running=[
(Output(‘forecast_tag_loading’, ‘children’),“Forecasting in progress”, “Forecasting finished”),
],
prevent_initial_call=True,
)

Here is my setup for long callback:

launch_uid = uuid4()
cache = diskcache.Cache("./cache")
long_callback_manager = DiskcacheLongCallbackManager(
cache, cache_by=[lambda: launch_uid], expire=60,
)
app._long_callback_manager=long_callback_manager

I can’t work out why the callback is running at the start even though prevent_initial_call is set to true does anyone know why it is?

FYI

1 Like