fix(usage): add missing await on getAdapter() in getRecentLogs
getAdapter() is async; without await, db was a Promise so db.all() threw and the outer try/catch returned [] silently — usage logs endpoints (/api/usage/logs, /api/usage/request-logs) always returned empty data. Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -700,7 +700,7 @@ export async function appendRequestLog() {}
|
||||
|
||||
export async function getRecentLogs(limit = 200) {
|
||||
try {
|
||||
const db = getAdapter();
|
||||
const db = await getAdapter();
|
||||
const rows = db.all(
|
||||
`SELECT timestamp, provider, model, connectionId, promptTokens, completionTokens, status, tokens FROM usageHistory ORDER BY id DESC LIMIT ?`,
|
||||
[limit],
|
||||
|
||||
Reference in New Issue
Block a user