chore: Add validation to prevent message flooding (#9254)

- Add a validation to limit messages created per minute to avoid message flooding cases.
This commit is contained in:
Sojan Jose
2024-04-18 00:14:59 -07:00
committed by GitHub
parent ca2fa5ff06
commit 15638e9b8b
3 changed files with 29 additions and 1 deletions

View File

@@ -4,4 +4,8 @@ module Limits
URL_LENGTH_LIMIT = 2048 # https://stackoverflow.com/questions/417142
OUT_OF_OFFICE_MESSAGE_MAX_LENGTH = 10_000
GREETING_MESSAGE_MAX_LENGTH = 10_000
def self.conversation_message_per_minute_limit
ENV.fetch('CONVERSATION_MESSAGE_PER_MINUTE_LIMIT', '200').to_i
end
end