several changes
This commit is contained in:
@@ -5,7 +5,7 @@ import { superTokensRequestMiddleware } from "@/utils/supertokens";
|
||||
|
||||
export const ServerRoute = createServerFileRoute("/api/events/$").middleware([superTokensRequestMiddleware]).methods({
|
||||
GET: ({ request, context }) => {
|
||||
logger.info('ServerEvents | New connection', (context as any)?.userAuthId);
|
||||
logger.info('ServerEvents | New connection', context?.userAuthId);
|
||||
|
||||
const stream = new ReadableStream({
|
||||
start(controller) {
|
||||
@@ -41,7 +41,7 @@ export const ServerRoute = createServerFileRoute("/api/events/$").middleware([su
|
||||
serverEvents.off("test", handleEvent);
|
||||
clearInterval(pingInterval);
|
||||
try {
|
||||
logger.info('ServerEvents | Closing connection', (context as any)?.userAuthId);
|
||||
logger.info('ServerEvents | Closing connection', context?.userAuthId);
|
||||
controller.close();
|
||||
} catch (e) {
|
||||
logger.error('ServerEvents | Error closing controller', e);
|
||||
|
||||
Reference in New Issue
Block a user