style: clean up code formatting and remove trailing whitespace
refactor: reorganize imports and fix type imports
This commit is contained in:
1 parent
d3704602fd
commit
47c04de6fe
232 files changed
+7140
-4798
No files matched your search
@@ -13,7 +13,9 @@ export interface TokenUsageRecord {
|
||||
|
||||
const KEY_PREFIX = "ai:usage";
|
||||
|
||||
export async function recordTokenUsage(record: TokenUsageRecord): Promise<void> {
|
||||
export async function recordTokenUsage(
|
||||
record: TokenUsageRecord,
|
||||
): Promise<void> {
|
||||
const redis = await getRedisClient();
|
||||
const dayKey = `${KEY_PREFIX}:day:${new Date(record.timestamp).toISOString().slice(0, 10)}`; // YYYY-MM-DD
|
||||
const listKey = `${KEY_PREFIX}:records`;
|
||||
@@ -31,4 +33,4 @@ export async function recordTokenUsage(record: TokenUsageRecord): Promise<void>
|
||||
pipeline.lTrim(listKey, 0, 9999);
|
||||
|
||||
await pipeline.exec();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user