Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/schedulable/acts_as_schedulable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def acts_as_schedulable(name, options = {})
max_period = Schedulable.config.max_build_period || 1.year
max_date = now + max_period

max_date = terminating ? [max_date, schedule.last.to_time].min : max_date
max_date = terminating && schedule.last ? [max_date, schedule.last.to_time].min : max_date

max_count = Schedulable.config.max_build_count || 100
max_count = terminating && schedule.remaining_occurrences.any? ? [max_count, schedule.remaining_occurrences.count].min : max_count
Expand Down