Spaces:
Sleeping
Sleeping
File size: 450 Bytes
e2f48a3 486ffa7 295d9d9 e2f48a3 295d9d9 e2f48a3 295d9d9 e2f48a3 295d9d9 e2f48a3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import { json } from "@sveltejs/kit";
import { logger } from "$lib/server/logger";
import { computeAllStats } from "$lib/jobs/refresh-conversation-stats";
// Triger like this:
// curl -X POST "http://localhost:5173/chat/admin/stats/compute" -H "Authorization: Bearer <ADMIN_API_SECRET>"
export async function POST() {
computeAllStats().catch((e) => logger.error(e));
return json(
{
message: "Stats job started",
},
{ status: 202 }
);
}
|