Skip to content

Commit 98d08f5

Browse files
feat: 2.0.3
feat: 2.0.3
2 parents 0eb98c1 + 0ffdadf commit 98d08f5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/services/createAlerts.service.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export const createAlerts = async (): Promise<void> => {
6464
async (alertMap: IAlertMap.IAlertMap): Promise<void> => {
6565
const alertMapAccountCode = alertMap.account_code;
6666
const alertMapZoneName = alertMap.zone_name;
67+
const alertMapQuantity = alertMap.quantity;
6768

6869
const fenceTrackerTrigger = await prisma.fence_tracker_triggers.findUnique(
6970
{
@@ -76,7 +77,7 @@ export const createAlerts = async (): Promise<void> => {
7677
}
7778
);
7879

79-
const alertMapQuantity = alertMap.quantity;
80+
const alertMapQuantityMultiple = Math.floor(alertMapQuantity / EVENTS_COUNT_THRESHOLD) * EVENTS_COUNT_THRESHOLD;
8081

8182
const processAlertMap = async (): Promise<void> => {
8283
await prisma.fence_tracker_triggers.create(
@@ -100,9 +101,7 @@ export const createAlerts = async (): Promise<void> => {
100101
params: { instance_id: process.env.CHAT_PRO_INSTANCE_ID }
101102
}
102103
);
103-
}
104-
105-
const alertMapQuantityMultiple = Math.floor(alertMapQuantity / EVENTS_COUNT_THRESHOLD) * EVENTS_COUNT_THRESHOLD;
104+
};
106105

107106
if (!fenceTrackerTrigger && alertMapQuantity >= EVENTS_COUNT_THRESHOLD) {
108107
processAlertMap();

0 commit comments

Comments
 (0)