Class: Gitlab::Mailgun::WebhookProcessors::FailureLogger
- Inherits:
-
Base
- Object
- Base
- Gitlab::Mailgun::WebhookProcessors::FailureLogger
show all
- Defined in:
- lib/gitlab/mailgun/webhook_processors/failure_logger.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#execute ⇒ Object
7
8
9
|
# File 'lib/gitlab/mailgun/webhook_processors/failure_logger.rb', line 7
def execute
log_failure if permanent_failure_over_threshold? || temporary_failure_over_threshold?
end
|
#permanent_failure_over_threshold? ⇒ Boolean
11
12
13
14
|
# File 'lib/gitlab/mailgun/webhook_processors/failure_logger.rb', line 11
def permanent_failure_over_threshold?
payload['event'] == 'failed' && payload['severity'] == 'permanent' &&
Gitlab::ApplicationRateLimiter.throttled?(:permanent_email_failure, scope: payload['recipient'])
end
|
#temporary_failure_over_threshold? ⇒ Boolean
16
17
18
19
|
# File 'lib/gitlab/mailgun/webhook_processors/failure_logger.rb', line 16
def temporary_failure_over_threshold?
payload['event'] == 'failed' && payload['severity'] == 'temporary' &&
Gitlab::ApplicationRateLimiter.throttled?(:temporary_email_failure, scope: payload['recipient'])
end
|