fix: migrate leftover old SSE code

This commit is contained in:
2026-04-09 05:03:18 +07:00 Unverified
parent 31b3ef0e5c
commit 86990bee24
3 changed files with 4 additions and 11 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import { NextResponse } from "next/server";
import { ps } from "@/lib/db/redis";
import { sse } from "@/lib/db/sse-endpoints";
export const revalidate = 900;
@@ -84,6 +84,6 @@ export async function GET() {
title: live.snippet.title,
};
await ps.publish(res, { event: "live", topic: "active" });
sse.active.pub("live", res);
return NextResponse.json<YoutubeLiveInfo>(res);
}
-9
View File
@@ -1,9 +0,0 @@
import { ps } from "@/lib/db/redis";
export async function GET(
_req: Request,
{ params }: { params: Promise<{ ver: string }> },
) {
const { ver } = await params;
return ps.new(`tl.${ver}`);
}
+2
View File
@@ -1,6 +1,7 @@
import z from "zod/v4";
import { sseEndpoint, sseEndpointMap } from "./redis";
import type { auditLog, tierlistStates } from "./schema";
import { YoutubeLiveInfo } from "@/app/api/live/route";
export const sse = sseEndpointMap({
// Artifact Admin Listener
@@ -33,6 +34,7 @@ export const sse = sseEndpointMap({
// Passive Update Checker
active: {
version: z.string(),
live: z.custom<YoutubeLiveInfo>(),
},
// Admin Live Log
log: {