app/models/scheduled_task.rb in tasks_scheduler-0.0.7 vs app/models/scheduled_task.rb in tasks_scheduler-0.0.8
- old
+ new
@@ -13,15 +13,19 @@
Rake.application.tasks.map(&:name)
end
end
end
- validates :scheduling, presence: true, 'tasks_scheduler/cron_scheduling': true
- validates :task, presence: true, inclusion: { in: rake_tasks }
-
STATUS_RUNNING = 'running'
STATUS_FAILED = 'failed'
STATUS_WAITING = 'waiting'
+ STATUS_ABORTED = 'aborted'
+
+ LAST_FAIL_STATUSES = [STATUS_FAILED, STATUS_ABORTED]
+
+ validates :scheduling, presence: true, 'tasks_scheduler/cron_scheduling': true
+ validates :task, presence: true, inclusion: { in: rake_tasks }
+ validates :last_fail_status, allow_blank: true, inclusion: { in: LAST_FAIL_STATUSES }
LOG_RUNNING = 'running'
LOG_SUCCESSFUL = 'successful'
LOG_UNSUCCESSFUL = 'unsuccessful'