Skip to content

Commit

Permalink
fix count of alert limits (#151)
Browse files Browse the repository at this point in the history
Co-authored-by: Markus Frindt <m.frindt@cognigy.com>
  • Loading branch information
Catharsis68 and Markus Frindt authored Sep 19, 2024
1 parent 3454232 commit b6d856c
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 95 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=linux/amd64 node:18.15-alpine3.16 as base
FROM --platform=linux/amd64 node:20.13.0-alpine3.18 as base

RUN apk --update --no-cache add --virtual .builds-deps build-base python3

Expand Down
4 changes: 2 additions & 2 deletions lib/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ module.exports = function(srf, logger) {
alert_type: AlertType.ACCOUNT_CALL_LIMIT,
service_provider_sid: service_provider_sid,
account_sid,
count: calls
count: account_limit
}).catch((err) => logger.info({err}, 'checkLimits: error writing alert'));
res.send(503, 'Max Account Calls In Progress', {
headers: {
Expand All @@ -327,7 +327,7 @@ module.exports = function(srf, logger) {
writeAlerts({
alert_type: AlertType.SP_CALL_LIMIT,
service_provider_sid: service_provider_sid,
count: callsSP
count: sp_limit
}).catch((err) => logger.info({err}, 'checkLimits: error writing alert'));
res.send(503, 'Max Service Provider Calls In Progress', {
headers: {
Expand Down
Loading

0 comments on commit b6d856c

Please sign in to comment.