fix: migrate leftover old SSE code
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
import { ps } from "@/lib/db/redis";
|
import { sse } from "@/lib/db/sse-endpoints";
|
||||||
|
|
||||||
export const revalidate = 900;
|
export const revalidate = 900;
|
||||||
|
|
||||||
@@ -84,6 +84,6 @@ export async function GET() {
|
|||||||
title: live.snippet.title,
|
title: live.snippet.title,
|
||||||
};
|
};
|
||||||
|
|
||||||
await ps.publish(res, { event: "live", topic: "active" });
|
sse.active.pub("live", res);
|
||||||
return NextResponse.json<YoutubeLiveInfo>(res);
|
return NextResponse.json<YoutubeLiveInfo>(res);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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}`);
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import z from "zod/v4";
|
import z from "zod/v4";
|
||||||
import { sseEndpoint, sseEndpointMap } from "./redis";
|
import { sseEndpoint, sseEndpointMap } from "./redis";
|
||||||
import type { auditLog, tierlistStates } from "./schema";
|
import type { auditLog, tierlistStates } from "./schema";
|
||||||
|
import { YoutubeLiveInfo } from "@/app/api/live/route";
|
||||||
|
|
||||||
export const sse = sseEndpointMap({
|
export const sse = sseEndpointMap({
|
||||||
// Artifact Admin Listener
|
// Artifact Admin Listener
|
||||||
@@ -33,6 +34,7 @@ export const sse = sseEndpointMap({
|
|||||||
// Passive Update Checker
|
// Passive Update Checker
|
||||||
active: {
|
active: {
|
||||||
version: z.string(),
|
version: z.string(),
|
||||||
|
live: z.custom<YoutubeLiveInfo>(),
|
||||||
},
|
},
|
||||||
// Admin Live Log
|
// Admin Live Log
|
||||||
log: {
|
log: {
|
||||||
|
|||||||
Reference in New Issue
Block a user