Merge pull request #4760 from Infisical/misc/added-health-and-ready-probe-endpoints

misc: added health and ready probe endpoints
This commit is contained in:
Sheen
2025-10-29 02:14:27 +08:00
committed by GitHub
10 changed files with 826 additions and 643 deletions
@@ -10,6 +10,7 @@ type TNotificationQueueServiceFactoryDep = {
export type TNotificationQueueServiceFactory = {
pushUserNotifications: (data: TCreateUserNotificationDTO[]) => Promise<void>;
init: () => Promise<void>;
};
export const notificationQueueServiceFactory = async ({
@@ -20,20 +21,23 @@ export const notificationQueueServiceFactory = async ({
await queueService.queuePg(QueueJobs.UserNotification, { notifications: data });
};
await queueService.startPg(
QueueJobs.UserNotification,
async ([job]) => {
const { notifications } = job.data as { notifications: TCreateUserNotificationDTO[] };
await userNotificationDAL.batchInsert(notifications);
},
{
batchSize: 1,
workerCount: 2,
pollingIntervalSeconds: 1
}
);
const init = async () => {
await queueService.startPg(
QueueJobs.UserNotification,
async ([job]) => {
const { notifications } = job.data as { notifications: TCreateUserNotificationDTO[] };
await userNotificationDAL.batchInsert(notifications);
},
{
batchSize: 1,
workerCount: 2,
pollingIntervalSeconds: 1
}
);
};
return {
pushUserNotifications
pushUserNotifications,
init
};
};