Skip to content

Commit

Permalink
Fixes #25562 - Product rendering issue when no recurring logic
Browse files Browse the repository at this point in the history
  • Loading branch information
sjha4 committed Nov 27, 2018
1 parent 095a037 commit df3dce6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/models/katello/sync_plan.rb
Expand Up @@ -118,8 +118,13 @@ def sync_time
end

def next_sync_date
return nil unless (self.enabled || !self.foreman_tasks_recurring_logic.tasks.nil?)
self.foreman_tasks_recurring_logic.tasks.order(:start_at).last.try(:start_at)
return nil if (self.foreman_tasks_recurring_logic.try(:tasks).nil? || !self.enabled )
begin
self.foreman_tasks_recurring_logic.tasks.order(:start_at).last.try(:start_at)
rescue Exception => e
Rails.logger.error "Error fetching next sync date for #{self.name} : " + e.message.to_s
nil
end
end

def next_sync
Expand Down

0 comments on commit df3dce6

Please sign in to comment.