Skip to content

Commit

Permalink
Update readme to use gunicorn + update snap interval
Browse files Browse the repository at this point in the history
  • Loading branch information
SinaKhalili committed Oct 16, 2024
1 parent cdc0c49 commit 94ff211
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Quick Start:
2. Create new venv `python -m venv .venv`
3. Activate venv `.venv/bin/activate`
4. Install dependencies `pip install -r requirements.txt`
5. In one terminal, run the backend with `uvicorn backend.app:app --host 0.0.0.0 --port 8000` (this might take a while to start up)
5. In one terminal, run the backend with `gunicorn backend.app:app -c gunicorn_config.py` (this might take a while to start up)
6. In another terminal, run the frontend with `streamlit run src/main.py`

Current Metrics:
Expand Down
6 changes: 3 additions & 3 deletions backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
state = BackendState()


@repeat_every(seconds=60 * 28, wait_first=True)
@repeat_every(seconds=60 * 15, wait_first=True)
async def repeatedly_retake_snapshot(state: BackendState) -> None:
await state.take_pickle_snapshot()

Expand Down Expand Up @@ -65,13 +65,13 @@ async def lifespan(app: FastAPI):
print("Loading cached vat")
await state.load_pickle_snapshot(cached_vat_path[-1])
await repeatedly_clean_cache(state)
# await repeatedly_retake_snapshot(state)
await repeatedly_retake_snapshot(state)
else:
print("No cached vat found, bootstrapping")
await state.bootstrap()
await state.take_pickle_snapshot()
await repeatedly_clean_cache(state)
# await repeatedly_retake_snapshot(state)
await repeatedly_retake_snapshot(state)
state.ready = True
print("Starting app")
yield
Expand Down

0 comments on commit 94ff211

Please sign in to comment.