Class: Orchestration::ServiceCheck
- Inherits:
-
Object
- Object
- Orchestration::ServiceCheck
- Defined in:
- lib/orchestration/service_check.rb
Constant Summary collapse
- ATTEMPT_LIMIT =
ENV.fetch('ORCHESTRATION_RETRY_LIMIT', '10').to_i
- RETRY_INTERVAL =
ENV.fetch('ORCHESTRATION_RETRY_INTERVAL', '5').to_i
Instance Method Summary collapse
-
#initialize(service, terminal, options = {}) ⇒ ServiceCheck
constructor
A new instance of ServiceCheck.
- #run ⇒ Object
Constructor Details
#initialize(service, terminal, options = {}) ⇒ ServiceCheck
Returns a new instance of ServiceCheck.
8 9 10 11 12 13 14 15 16 |
# File 'lib/orchestration/service_check.rb', line 8 def initialize(service, terminal, = {}) @service = service @service_name = service.service_name @terminal = terminal @attempt_limit = .fetch(:attempt_limit, ATTEMPT_LIMIT) @retry_interval = .fetch(:retry_interval, RETRY_INTERVAL) @attempts = 0 @failure_callback = .fetch(:failure_callback, nil) end |
Instance Method Details
#run ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/orchestration/service_check.rb', line 18 def run return echo_missing unless @service.configuration.configured? echo_start success = attempt_connection echo_ready if success success end |