mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 05:27:52 +00:00
don't notify "invited" admins about health alerts
This commit is contained in:
@@ -909,7 +909,9 @@ export const gatewayV2ServiceFactory = ({
|
|||||||
|
|
||||||
for await (const [orgId, gateways] of Object.entries(gatewaysByOrg)) {
|
for await (const [orgId, gateways] of Object.entries(gatewaysByOrg)) {
|
||||||
try {
|
try {
|
||||||
const admins = await orgDAL.findOrgMembersByRole(orgId, OrgMembershipRole.Admin);
|
const admins = (await orgDAL.findOrgMembersByRole(orgId, OrgMembershipRole.Admin)).filter(
|
||||||
|
(admin) => admin.status !== "invited"
|
||||||
|
);
|
||||||
if (admins.length === 0) {
|
if (admins.length === 0) {
|
||||||
logger.warn({ orgId }, "Organization has no admins to notify about unhealthy gateway.");
|
logger.warn({ orgId }, "Organization has no admins to notify about unhealthy gateway.");
|
||||||
// eslint-disable-next-line no-continue
|
// eslint-disable-next-line no-continue
|
||||||
|
|||||||
@@ -1248,7 +1248,9 @@ export const relayServiceFactory = ({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const admins = await orgDAL.findOrgMembersByRole(orgId, OrgMembershipRole.Admin);
|
const admins = (await orgDAL.findOrgMembersByRole(orgId, OrgMembershipRole.Admin)).filter(
|
||||||
|
(admin) => admin.status !== "invited"
|
||||||
|
);
|
||||||
if (admins.length === 0) {
|
if (admins.length === 0) {
|
||||||
// eslint-disable-next-line no-continue
|
// eslint-disable-next-line no-continue
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user