mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-07 21:29:13 +00:00
Put the telemetry db in a separate directory by default
This commit is contained in:
@@ -12,7 +12,7 @@ import uvicorn
|
|||||||
|
|
||||||
# Initialize Global App Variables
|
# Initialize Global App Variables
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
sqlfile = "khoj.sqlite"
|
sqlfile = "data/khoj.sqlite"
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
logger.setLevel(logging.DEBUG)
|
logger.setLevel(logging.DEBUG)
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ def v1_telemetry(telemetry_data: List[Dict[str, str]]):
|
|||||||
raise HTTPException(status_code=500, detail=error_message)
|
raise HTTPException(status_code=500, detail=error_message)
|
||||||
|
|
||||||
# Insert recieved telemetry data into SQLite db
|
# Insert recieved telemetry data into SQLite db
|
||||||
logger.info(f"Insert row into telemetry table: {telemetry_data}")
|
logger.info(f"Insert row into telemetry table at {sqlfile}: {telemetry_data}")
|
||||||
with sqlite3.connect(sqlfile) as conn:
|
with sqlite3.connect(sqlfile) as conn:
|
||||||
cur = conn.cursor()
|
cur = conn.cursor()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user