[hosted app, Google Cloud] Callback stops working after time away from computer

I have created and uploaded a simple Dash app with one callback.

The callback works perfectly when I load the page https://dash-app-3-michelinreviews.ts.r.appspot.com/

However, if I leave the tab open in the background, and then return to it after some time, the callback takes FOREVER to load. after clicking it a few times back and forth it is immediate again.

I am unsure if this issue is from Dash or Google Cloud. Has anyone seen this error before?

1 Like

Hello @plotmaster422,

More than likely, you are running into an issue where the app is spinning down.

hello @jinnyzor! Could you elaborate on that?

If a server is not set to always be available. When you don’t interact with it, it will go to sleep until the next request comes in. At that time, it spins up the app again. Which is why it probably takes the same amount of time as spinning up the app in the first place.

Gotcha. That’s very helpful, thank you!

Do you know if it’s possible to prevent the app from going to sleep?

There should be a setting on the hosted service to turn it on.

Another way is to ping the site every couple of minutes.

1 Like

Got it, so it’s a Google Cloud Service problem. Awesome. Thanks for your help!

1 Like