# Unexpected delay while building Gradio server

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Funexpected-delay-while-building-gradio-server%2F151592%3E%5C
**Category:** Spaces\
**Created:** [April 21, 2025, 11:07am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Funexpected-delay-while-building-gradio-server%2F151592 "2025-04-21T11:07:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kangyeolk](https://avatars.discourse-cdn.com/v4/letter/k/74df32/32.png) [@kangyeolk](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fkangyeolk)%5C
**Post date:** [April 21, 2025, 11:07am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Funexpected-delay-while-building-gradio-server%2F151592%2F1 "2025-04-21T11:07:21Z")

</div>

When I create a private space using the free hardware setting, and then try to restart it after it goes into sleep mode, it stays in the “BUILDING” state for a very long time.  
Is there any way to reduce or avoid this delay?

1. One idea I had was to upgrade the hardware spec so that the space doesn’t go to sleep at all. Is this possible?
2. If I subscribe to Pro mode, do I get priority in the building queue?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [April 21, 2025, 11:37am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Funexpected-delay-while-building-gradio-server%2F151592%2F2 "2025-04-21T11:37:37Z")

</div>

> [@Issue with FlaskAPI in a Private Space After Sleeping Mode](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fissue-with-flaskapi-in-a-private-space-after-sleeping-mode%2F147150)%3A
>
> Hey everyone, I’m facing an issue with my FlaskAPI running in a private Hugging Face Space. I’ve set the space to enter sleeping mode after some time to save resources. However, when I try to wake it up after a few hours by sending a GET/POST request, I get a 404 error. I suspect this might be related to the spaces-jwt token refreshing periodically. I found this thread discussing JWT expiration settings: [/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-modify-the-fastapi-jwt-token-expiration-setting-i%E2%80%A6%5D(https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-modify-the-fastapi-jwt-token-expiration-setting-issued-by-huggingface%2F78593)

I think there may be a bug in Spaces’ sleep mode…

> 2

Maybe no.

> 1

It may be possible to configure this via Python, regardless of whether it is paid or free.

> **[Manage your Space](https://huggingface.co/docs/huggingface_hub/guides/manage-spaces)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

> Put your Space to sleep after 1h of inactivity  
> api.set\_space\_sleep\_time(repo\_id=repo\_id, sleep\_time=3600)
