You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.
We may want to impose a limit over calls made to IBM Watson.
A quick option, although insecure, is to save the number of requests per session in a map. If a user utilizes more than x calls, block him until next session.
/*if (requestNumber.get(req.user.email) > 100) {
UtilsRoutes.replyFailure(res,e,"Too many requests. Please try later");
ba_logger.important("BA|CHATBOT|WARNING|TOO MANY REQUEST|" + req.user.email);
throw new Error ("Too many requests");
}*/
A better solution would be to persist the number of calls, imposing a limit. When the limit is crossed, the calls are blocked for that user, and a timestamp is saved. After x time passes, the user can make calls again.
The text was updated successfully, but these errors were encountered:
We may want to impose a limit over calls made to IBM Watson.
A quick option, although insecure, is to save the number of requests per session in a map. If a user utilizes more than x calls, block him until next session.
A better solution would be to persist the number of calls, imposing a limit. When the limit is crossed, the calls are blocked for that user, and a timestamp is saved. After x time passes, the user can make calls again.
The text was updated successfully, but these errors were encountered: