Class: Google::Apis::CloudtasksV2beta2::RetryConfig
- Inherits:
-
Object
- Object
- Google::Apis::CloudtasksV2beta2::RetryConfig
- Defined in:
- generated/google/apis/cloudtasks_v2beta2/classes.rb,
generated/google/apis/cloudtasks_v2beta2/representations.rb,
generated/google/apis/cloudtasks_v2beta2/representations.rb
Overview
Retry config. These settings determine retry behavior. If a task does not complete successfully, meaning that an acknowledgement is not received from the handler before the deadline, then it will be retried with exponential backoff according to the settings in RetryConfig.
Instance Attribute Summary collapse
-
#max_attempts ⇒ Fixnum
The maximum number of attempts for a task.
-
#max_backoff ⇒ String
The maximum amount of time to wait before retrying a task after it fails.
-
#max_doublings ⇒ Fixnum
The maximum number of times that the interval between failed task retries will be doubled before the increase becomes constant.
-
#min_backoff ⇒ String
The minimum amount of time to wait before retrying a task after it fails.
-
#task_age_limit ⇒ String
If positive, task_age_limit specifies the time limit for retrying a failed task, measured from when the task was first run.
-
#unlimited_attempts ⇒ Boolean
(also: #unlimited_attempts?)
If true, then the number of attempts is unlimited.
Instance Method Summary collapse
-
#initialize(**args) ⇒ RetryConfig
constructor
A new instance of RetryConfig.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Google::Apis::Core::JsonObjectSupport
Methods included from Google::Apis::Core::Hashable
Constructor Details
#initialize(**args) ⇒ RetryConfig
Returns a new instance of RetryConfig
1274 1275 1276 |
# File 'generated/google/apis/cloudtasks_v2beta2/classes.rb', line 1274 def initialize(**args) update!(**args) end |
Instance Attribute Details
#max_attempts ⇒ Fixnum
The maximum number of attempts for a task.
Cloud Tasks will attempt the task max_attempts
times (that
is, if the first attempt fails, then there will be
max_attempts - 1
retries). Must be > 0.
Corresponds to the JSON property maxAttempts
1222 1223 1224 |
# File 'generated/google/apis/cloudtasks_v2beta2/classes.rb', line 1222 def max_attempts @max_attempts end |
#max_backoff ⇒ String
The maximum amount of time to wait before retrying a task after it fails. The default is 1 hour.
- For App Engine queues, this field is 1 hour by default.
- For pull queues, this field
is output only and always 0.
max_backoff
will be truncated to the nearest second. Corresponds to the JSON propertymaxBackoff
1233 1234 1235 |
# File 'generated/google/apis/cloudtasks_v2beta2/classes.rb', line 1233 def max_backoff @max_backoff end |
#max_doublings ⇒ Fixnum
The maximum number of times that the interval between failed task retries will be doubled before the increase becomes constant. The constant is: 2**(max_doublings - 1) * RetryConfig.min_backoff.
- For App Engine queues, this field is 16 by default.
- For pull queues, this field
is output only and always 0.
Corresponds to the JSON property
maxDoublings
1245 1246 1247 |
# File 'generated/google/apis/cloudtasks_v2beta2/classes.rb', line 1245 def max_doublings @max_doublings end |
#min_backoff ⇒ String
The minimum amount of time to wait before retrying a task after it fails.
- For App Engine queues, this field is 0.1 seconds by default.
- For pull queues, this
field is output only and always 0.
min_backoff
will be truncated to the nearest second. Corresponds to the JSON propertyminBackoff
1256 1257 1258 |
# File 'generated/google/apis/cloudtasks_v2beta2/classes.rb', line 1256 def min_backoff @min_backoff end |
#task_age_limit ⇒ String
If positive, task_age_limit specifies the time limit for retrying a failed
task, measured from when the task was first run. If specified with
RetryConfig.max_attempts, the task will be retried until both
limits are reached.
If zero, then the task age is unlimited. This field is zero by default.
task_age_limit
will be truncated to the nearest second.
Corresponds to the JSON property taskAgeLimit
1266 1267 1268 |
# File 'generated/google/apis/cloudtasks_v2beta2/classes.rb', line 1266 def task_age_limit @task_age_limit end |
#unlimited_attempts ⇒ Boolean Also known as: unlimited_attempts?
If true, then the number of attempts is unlimited.
Corresponds to the JSON property unlimitedAttempts
1271 1272 1273 |
# File 'generated/google/apis/cloudtasks_v2beta2/classes.rb', line 1271 def unlimited_attempts @unlimited_attempts end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1279 1280 1281 1282 1283 1284 1285 1286 |
# File 'generated/google/apis/cloudtasks_v2beta2/classes.rb', line 1279 def update!(**args) @max_attempts = args[:max_attempts] if args.key?(:max_attempts) @max_backoff = args[:max_backoff] if args.key?(:max_backoff) @max_doublings = args[:max_doublings] if args.key?(:max_doublings) @min_backoff = args[:min_backoff] if args.key?(:min_backoff) @task_age_limit = args[:task_age_limit] if args.key?(:task_age_limit) @unlimited_attempts = args[:unlimited_attempts] if args.key?(:unlimited_attempts) end |