fix: 修复发布问题
This commit is contained in:
@@ -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)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user