Skip to content

Commit

Permalink
Use TMPDIR for the visits.csv file instead of the code dir
Browse files Browse the repository at this point in the history
  • Loading branch information
vladsavelyev committed Feb 21, 2024
1 parent 2f570e9 commit c4bcf8e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from pathlib import Path

import http

import csv
import datetime
import logging
import os
import sys
from pathlib import Path
from threading import Lock

import uvicorn
Expand Down Expand Up @@ -116,7 +117,7 @@ async def version(

# Path to a buffer CSV file to persist recent visits before dumping to the database
# In the same folder as this script
CSV_FILE_PATH = Path(__file__).parent / "visits.csv"
CSV_FILE_PATH = Path(os.getenv("TMPDIR")) / "visits.csv"


@app.on_event("startup")
Expand Down

0 comments on commit c4bcf8e

Please sign in to comment.