Module: Config::OCIClientRetryConfig

Extended by:
Util::Logging
Defined in:
lib/config/oci_client_retry_config.rb

Constant Summary

Constants included from Util::Logging

Util::Logging::SEV_LABEL, Util::Logging::TRACE

Class Method Summary collapse

Methods included from Util::Logging

logger, logger=

Class Method Details

.get_retry_configObject



30
31
32
# File 'lib/config/oci_client_retry_config.rb', line 30

def get_retry_config
  @retry_config.nil? ? set_default_retry_config : @retry_config
end

.set_custom_retry_config(custom_retry_config) ⇒ Object



26
27
28
# File 'lib/config/oci_client_retry_config.rb', line 26

def set_custom_retry_config(custom_retry_config)
  @retry_config = custom_retry_config
end

.set_default_retry_configObject



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/config/oci_client_retry_config.rb', line 14

def set_default_retry_config
  OCI::Retry::RetryConfig.new(
    base_sleep_time_millis: 1000,
    exponential_growth_factor: 2,
    should_retry_exception_proc: OCI::Retry::Functions::ShouldRetryOnError.retry_on_network_error_throttle_and_internal_server_errors,
    sleep_calc_millis_proc: OCI::Retry::Functions::Sleep.exponential_backoff_with_full_jitter,
    max_attempts: 5,
    max_elapsed_time_millis: 300_000, # 5 minutes
    max_sleep_between_attempts_millis: 10_000
  )
end