mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 20:00:47 +00:00
Fix Kiro token refresh logic
This commit is contained in:
@@ -228,6 +228,13 @@ export async function appendRequestLog({ model, provider, connectionId, tokens,
|
||||
const line = `${timestamp} | ${m} | ${p} | ${account} | ${sent} | ${received} | ${status}\n`;
|
||||
|
||||
fs.appendFileSync(LOG_FILE, line);
|
||||
|
||||
// Trim to keep only last 200 lines
|
||||
const content = fs.readFileSync(LOG_FILE, "utf-8");
|
||||
const lines = content.trim().split("\n");
|
||||
if (lines.length > 200) {
|
||||
fs.writeFileSync(LOG_FILE, lines.slice(-200).join("\n") + "\n");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to append to log.txt:", error.message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user