Spaces:
Running
Running
Commit ·
24e7df9
1
Parent(s): 6c28794
chore: update background scraper loop interval to 5 minutes
Browse files
main.py
CHANGED
|
@@ -27,12 +27,12 @@ async def background_scraper_loop():
|
|
| 27 |
# Crypto scraper is synchronous, so we run it in a thread to prevent blocking
|
| 28 |
await asyncio.to_thread(scrape_crypto.run)
|
| 29 |
|
| 30 |
-
logger.info("Scraping cycle complete. Sleeping for
|
| 31 |
except Exception as e:
|
| 32 |
logger.error(f"Error during scraping cycle: {e}")
|
| 33 |
|
| 34 |
-
# Sleep for
|
| 35 |
-
await asyncio.sleep(
|
| 36 |
|
| 37 |
@asynccontextmanager
|
| 38 |
async def lifespan(app: FastAPI):
|
|
|
|
| 27 |
# Crypto scraper is synchronous, so we run it in a thread to prevent blocking
|
| 28 |
await asyncio.to_thread(scrape_crypto.run)
|
| 29 |
|
| 30 |
+
logger.info("Scraping cycle complete. Sleeping for 5 minutes.")
|
| 31 |
except Exception as e:
|
| 32 |
logger.error(f"Error during scraping cycle: {e}")
|
| 33 |
|
| 34 |
+
# Sleep for 5 minutes (300 seconds)
|
| 35 |
+
await asyncio.sleep(300)
|
| 36 |
|
| 37 |
@asynccontextmanager
|
| 38 |
async def lifespan(app: FastAPI):
|