fix: 修复发布问题

This commit is contained in:
richarjiang
2026-03-16 22:00:47 +08:00
parent a230122faf
commit ab00443056
3 changed files with 5 additions and 5 deletions

View File

@@ -8,7 +8,7 @@
import { db } from "@/lib/db";
import { claws, heartbeats, tasks, tokenUsage, geoCache } from "@/lib/db/schema";
import { sql } from "drizzle-orm";
import { redis, redisSubscriber } from "@/lib/redis";
import { redis } from "@/lib/redis";
async function clearMockData() {
console.log("🧹 开始清理数据...\n");

View File

@@ -51,7 +51,7 @@ const TOOLS_USED = [
];
// 全局变量存储所有 claws
let allClaws: { id: string; name: string; model: string; city: string | null; country: string | null }[] = [];
let allClaws: { id: string; name: string; model: string | null; city: string | null; country: string | null }[] = [];
async function loadClaws() {
const result = await db

View File

@@ -7,7 +7,7 @@
import { db } from "@/lib/db";
import { claws, heartbeats, tasks, tokenUsage } from "@/lib/db/schema";
import { sql, eq, and, gte } from "drizzle-orm";
import { sql, eq, and, gte, lte } from "drizzle-orm";
import { redis } from "@/lib/redis";
const ACTIVE_CLAWS_KEY = "active:claws";
@@ -80,7 +80,7 @@ async function syncRedisStats() {
.where(sql`region IS NOT NULL`)
.groupBy(claws.region);
const regionData: Record<string, string> = {};
const regionData: Record<string, number> = {};
for (const stat of regionStats) {
if (stat.region) {
regionData[stat.region] = stat.count;
@@ -129,7 +129,7 @@ async function syncRedisStats() {
.where(
and(
gte(heartbeats.timestamp, hourStart),
gte(hourEnd, heartbeats.timestamp)
lte(heartbeats.timestamp, hourEnd)
)
);