diff --git a/lib/tasks/update_partial_effort_in_demand.rake b/lib/tasks/update_partial_effort_in_demand.rake index 5da93c1ac..08a33fdd6 100644 --- a/lib/tasks/update_partial_effort_in_demand.rake +++ b/lib/tasks/update_partial_effort_in_demand.rake @@ -6,15 +6,13 @@ namespace :demands do task update_partial_effort: :environment do return unless Time.zone.now.hour.between?(8, 21) - Demand.in_flow(Time.zone.now).each do |demand| + Demand.kept.in_flow(Time.zone.now).each do |demand| jira_account = demand.company.jira_accounts.first if jira_account.present? Jira::ProcessJiraIssueJob.perform_later(jira_account, demand.project, demand.external_id, '', '', '') - - DemandEffortService.instance.build_efforts_to_demand(demand) else - demand.destroy + demand.discard end end end