Class: WebHooks::LogExecutionService
- Inherits:
-
Object
- Object
- WebHooks::LogExecutionService
- Includes:
- Gitlab::ExclusiveLeaseHelpers
- Defined in:
- app/services/web_hooks/log_execution_service.rb
Constant Summary collapse
- LOCK_TTL =
15.seconds.freeze
- LOCK_SLEEP =
0.25.seconds.freeze
- LOCK_RETRY =
65
Constants included from Gitlab::ExclusiveLeaseHelpers
Gitlab::ExclusiveLeaseHelpers::FailedToObtainLockError
Instance Attribute Summary collapse
-
#hook ⇒ Object
readonly
Returns the value of attribute hook.
-
#log_data ⇒ Object
readonly
Returns the value of attribute log_data.
-
#response_category ⇒ Object
readonly
Returns the value of attribute response_category.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(hook:, log_data:, response_category:) ⇒ LogExecutionService
constructor
A new instance of LogExecutionService.
Methods included from Gitlab::ExclusiveLeaseHelpers
Constructor Details
#initialize(hook:, log_data:, response_category:) ⇒ LogExecutionService
Returns a new instance of LogExecutionService.
13 14 15 16 17 |
# File 'app/services/web_hooks/log_execution_service.rb', line 13 def initialize(hook:, log_data:, response_category:) @hook = hook @log_data = log_data.transform_keys(&:to_sym) @response_category = response_category end |
Instance Attribute Details
#hook ⇒ Object (readonly)
Returns the value of attribute hook.
11 12 13 |
# File 'app/services/web_hooks/log_execution_service.rb', line 11 def hook @hook end |
#log_data ⇒ Object (readonly)
Returns the value of attribute log_data.
11 12 13 |
# File 'app/services/web_hooks/log_execution_service.rb', line 11 def log_data @log_data end |
#response_category ⇒ Object (readonly)
Returns the value of attribute response_category.
11 12 13 |
# File 'app/services/web_hooks/log_execution_service.rb', line 11 def response_category @response_category end |
Instance Method Details
#execute ⇒ Object
19 20 21 22 |
# File 'app/services/web_hooks/log_execution_service.rb', line 19 def execute update_hook_failure_state log_execution end |