Module: JobIteration::Iteration
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/job-iteration/iteration.rb
Defined Under Namespace
Modules: ClassMethods Classes: CursorError
Instance Attribute Summary collapse
-
#cursor_position ⇒ Object
Returns the value of attribute cursor_position.
-
#start_time ⇒ Object
The time when the job starts running.
-
#total_time ⇒ Object
The total time (in seconds) the job has been running, including multiple iterations.
Instance Method Summary collapse
Instance Attribute Details
#cursor_position ⇒ Object
Returns the value of attribute cursor_position.
9 10 11 |
# File 'lib/job-iteration/iteration.rb', line 9 def cursor_position @cursor_position end |
#start_time ⇒ Object
The time when the job starts running. If the job is interrupted and runs again, the value is updated.
15 16 17 |
# File 'lib/job-iteration/iteration.rb', line 15 def start_time @start_time end |
#total_time ⇒ Object
The total time (in seconds) the job has been running, including multiple iterations. The time isn't reset if the job is interrupted.
19 20 21 |
# File 'lib/job-iteration/iteration.rb', line 19 def total_time @total_time end |
Instance Method Details
#initialize(*arguments) ⇒ Object
85 86 87 88 89 90 91 92 |
# File 'lib/job-iteration/iteration.rb', line 85 def initialize(*arguments) super @job_iteration_retry_backoff = JobIteration.default_retry_backoff @needs_reenqueue = false self.times_interrupted = 0 self.total_time = 0.0 assert_implements_methods! end |
#retry_job ⇒ Object
116 117 118 119 |
# File 'lib/job-iteration/iteration.rb', line 116 def retry_job(*, **) super unless defined?(@retried) && @retried @retried = true end |