Skip to content

Commit

Permalink
chore: improved demand update chore
Browse files Browse the repository at this point in the history
  • Loading branch information
celsoMartins committed Nov 21, 2023
1 parent 2162734 commit a4e6135
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/tasks/update_partial_effort_in_demand.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a4e6135

Please sign in to comment.