Class: AcidicJob::Run
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- AcidicJob::Run
- Includes:
- GlobalID::Identification
- Defined in:
- lib/acidic_job/run.rb
Constant Summary collapse
- FINISHED_RECOVERY_POINT =
"FINISHED"
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.purge ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/acidic_job/run.rb', line 38 def self.purge successfully_completed = where( recovery_point: FINISHED_RECOVERY_POINT, error_object: nil ) count = successfully_completed.count return 0 if count.zero? Rails.logger.info("Deleting #{count} successfully completed AcidicJob runs") successfully_completed.delete_all end |
Instance Method Details
#failed? ⇒ Boolean
59 60 61 |
# File 'lib/acidic_job/run.rb', line 59 def failed? error_object.present? end |
#finished? ⇒ Boolean
51 52 53 |
# File 'lib/acidic_job/run.rb', line 51 def finished? recovery_point == FINISHED_RECOVERY_POINT end |
#succeeded? ⇒ Boolean
55 56 57 |
# File 'lib/acidic_job/run.rb', line 55 def succeeded? finished? && !failed? end |