Fly.io down, or is it just me?

So my app stopped responding a few minutes ago, and apparently it’s having a problem:

I haven’t done any deployments over the last 48 hours.

The status website says all is well:

…so I’m assuming it’s very likely just me, or perhaps a small subset of users who are affected.

The question I have: is how do I troubleshoot? In a case like this I’d normally try restarting my app and see if that fixes things, but haven’t had much luck there.

I’ve looked high and low in the dashboard for things I can try, but no luck. Doe anyone have any suggestions? I feel as though I am missing something trivial.

Thanks,

– Doug

Welp, I’m happy(?) to say that it was just me. :slight_smile: I’ll share what happened here so that others can learn.

I am bulding an app in FastAPI and I have an endpoint which has the webserver pause for a predetermined number of seconds before returning data. I was doing the pausing on the server side with this code:

time.sleep(x)

Can anyone see the flaw here? :slight_smile: Yep, turns out that doing a regular sleep() in an asynchronous app causes the entire app to come to a stop. So if I sleep for 5 seconds, I just added 5 seconds to every other API call.

Here is the correct way to sleep in FastAPI:

await asyncio.sleep(x)

That will put that specific request to sleep for the chosen amount of time, and no other requests will be affected.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.