diff --git a/backend/src/ee/services/event/event-sse-service.ts b/backend/src/ee/services/event/event-sse-service.ts index f8c025e77..bb85f667c 100644 --- a/backend/src/ee/services/event/event-sse-service.ts +++ b/backend/src/ee/services/event/event-sse-service.ts @@ -13,11 +13,9 @@ const AUTH_REFRESH_INTERVAL = 60 * 1000; const HEART_BEAT_INTERVAL = 15 * 1000; export const sseServiceFactory = (bus: TEventBusService, redis: Redis) => { - let heartbeatInterval: NodeJS.Timeout | null = null; - const clients = new Set(); - heartbeatInterval = setInterval(() => { + const heartbeatInterval = setInterval(() => { for (const client of clients) { if (client.stream.closed) continue; void client.ping(); diff --git a/backend/src/ee/services/event/event-sse-stream.ts b/backend/src/ee/services/event/event-sse-stream.ts index 4c5fcf779..258783c2e 100644 --- a/backend/src/ee/services/event/event-sse-stream.ts +++ b/backend/src/ee/services/event/event-sse-stream.ts @@ -78,7 +78,7 @@ export function createEventStreamClient(redis: Redis, options: IEventStreamClien ...(hasConditions ? { environment: r.conditions?.environmentSlug ?? "", - secretPath: r.conditions?.recursive ? { $glob: `${secretPath}/**` } : secretPath + secretPath: { $glob: secretPath } } : {}) } diff --git a/backend/src/ee/services/event/types.ts b/backend/src/ee/services/event/types.ts index 72227c863..721e6ea13 100644 --- a/backend/src/ee/services/event/types.ts +++ b/backend/src/ee/services/event/types.ts @@ -117,8 +117,7 @@ export const EventRegisterSchema = z.object({ conditions: z .object({ secretPath: z.string().optional().default("/"), - environmentSlug: z.string(), - recursive: z.boolean().optional().default(false) + environmentSlug: z.string() }) .optional() }); diff --git a/backend/src/server/routes/v1/event-router.ts b/backend/src/server/routes/v1/event-router.ts index c37908944..19dc296bf 100644 --- a/backend/src/server/routes/v1/event-router.ts +++ b/backend/src/server/routes/v1/event-router.ts @@ -26,7 +26,7 @@ export const registerEventRouter = async (server: FastifyZodProvider) => { description: "Subscribe to project events", body: z.object({ projectId: z.string().trim().describe(EventSubscriptions.SUBSCRIBE_PROJECT_EVENTS.projectId), - register: z.array(EventRegisterSchema).max(10) + register: z.array(EventRegisterSchema).min(1).max(10) }), produces: ["text/event-stream"] },