INNER CODE UNIT · Python
lifespan
jaypyles/Scraperr · api/backend/app.py:34
async def lifespan(_: FastAPI):
# Startup
LOG.info("Starting application...")
LOG.info("Starting cron scheduler...")
await start_cron_scheduler(scheduler)
scheduler.start()
LOG.info("Cron scheduler started successfully")
yield
# Shutdown
LOG.info("Shutting down application...")
LOG.info("Stopping cron scheduler...")
scheduler.shutdown(wait=False) # Set wait=False to not block shutdown
LOG.info("Cron scheduler stopped")
LOG.info("Application shutdown complete")