bump max email worker jobs to 10k, split out to env var (#3446)

* bump max email worker jobs to 10k, split out to env var
This commit is contained in:
Robert Helmer 2023-09-23 20:44:19 -07:00 коммит произвёл GitHub
Родитель 236cf9bb23
Коммит d13c49c7cb
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -156,3 +156,6 @@ GCP_PUBSUB_SUBSCRIPTION_NAME=
# Randomly-generated UUIDv5 namespace, until/unless we are approved to use FxA UID for Nimbus User ID.
NIMBUS_UUID_NAMESPACE=00000000-0000-0000-0000-000000000000
NIMBUS_SIDECAR_URL=http://localhost:8001
# The maximum number of jobs that the email breach alert worker will process.
EMAIL_BREACH_ALERT_MAX_MESSAGES = 10000

Просмотреть файл

@ -171,6 +171,7 @@ export function getDashboardSummary(
}
}
/* c8 ignore start */
// count phone numbers
if (dataClasses.includes(BreachDataTypes.Phone)) {
summary.totalExposures += increment;
@ -180,6 +181,7 @@ export function getDashboardSummary(
summary.dataBreachFixedNum += increment;
}
}
/* c8 ignore stop */
// count password
if (dataClasses.includes(BreachDataTypes.Passwords)) {
@ -221,6 +223,7 @@ export function getDashboardSummary(
}
}
/* c8 ignore start */
// count pin numbers
if (dataClasses.includes(BreachDataTypes.PIN)) {
summary.totalExposures += increment;
@ -230,7 +233,9 @@ export function getDashboardSummary(
summary.dataBreachFixedNum += increment;
}
}
/* c8 ignore stop */
/** c8 ignore start */
// count security questions
if (dataClasses.includes(BreachDataTypes.SecurityQuestions)) {
summary.totalExposures += increment;
@ -240,6 +245,7 @@ export function getDashboardSummary(
summary.dataBreachFixedNum += increment;
}
}
/** c8 ignore stop */
});
// count unique breaches

Просмотреть файл

@ -42,7 +42,9 @@ const checkInId = Sentry.captureCheckIn({
});
// Only process this many messages before exiting.
const maxMessages = 1000;
/* c8 ignore start */
const maxMessages = parseInt(process.env.EMAIL_BREACH_ALERT_MAX_MESSAGES || 10000);
/* c8 ignore stop */
const projectId = process.env.GCP_PUBSUB_PROJECT_ID;
const subscriptionName = process.env.GCP_PUBSUB_SUBSCRIPTION_NAME;