Spaces:
Sleeping
Sleeping
Commit ·
24e7df9
1
Parent(s): 6c28794
chore: update background scraper loop interval to 5 minutes
Browse files26 unmodified lines27282930313233343536373826 unmodified lines# Crypto scraper is synchronous, so we run it in a thread to prevent blockingawait asyncio.to_thread(scrape_crypto.run)logger.info("Scraping cycle complete. Sleeping for 10 minutes.")except Exception as e:logger.error(f"Error during scraping cycle: {e}")# Sleep for 10 minutes (600 seconds)await asyncio.sleep(600)@asynccontextmanagerasync def lifespan(app: FastAPI):26 unmodified lines27282930313233343536373826 unmodified lines# Crypto scraper is synchronous, so we run it in a thread to prevent blockingawait asyncio.to_thread(scrape_crypto.run)logger.info("Scraping cycle complete. Sleeping for 5 minutes.")except Exception as e:logger.error(f"Error during scraping cycle: {e}")# Sleep for 5 minutes (300 seconds)await asyncio.sleep(300)@asynccontextmanagerasync def lifespan(app: FastAPI):
main.py+3-3