Skip to content

Commit

Permalink
fix: db error
Browse files Browse the repository at this point in the history
  • Loading branch information
g0ldyy committed Jul 24, 2024
1 parent 2f004cc commit d1232ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion comet/api/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,8 @@ async def stream(request: Request, b64config: str, type: str, id: str):

json_data = json.dumps(sorted_ranked_files).replace("'", "''")
await database.execute(
f"INSERT OR IGNORE INTO cache (cacheKey, results, timestamp) VALUES ('{cache_key}', '{json_data}', {time.time()})"
f"INSERT OR IGNORE INTO cache (cacheKey, results, timestamp) VALUES (:cache_key, :json_data, :timestamp)",
{"cache_key": cache_key, "json_data": json_data, "timestamp": time.time()},
)
logger.info(f"Results have been cached for {log_name}")

Expand Down

0 comments on commit d1232ce

Please sign in to comment.