Only run process expired dossiers task on production servers
This commit is contained in:
parent
d810fdf474
commit
afc76f3066
1 changed files with 12 additions and 10 deletions
|
@ -3,6 +3,7 @@ namespace :after_party do
|
|||
task process_expired_dossiers_en_construction: :environment do
|
||||
puts "Running deploy task 'process_expired_dossiers_en_construction'"
|
||||
|
||||
if ENV['APP_NAME'] == 'tps'
|
||||
dossiers_close_to_expiration = Dossier
|
||||
.en_construction_close_to_expiration
|
||||
.without_en_construction_expiration_notice_sent
|
||||
|
@ -17,6 +18,7 @@ namespace :after_party do
|
|||
.limit(BATCH_SIZE)
|
||||
.update_all(en_construction_close_to_expiration_notice_sent_at: Time.zone.now + n.days)
|
||||
end
|
||||
end
|
||||
|
||||
# Update task as completed. If you remove the line below, the task will
|
||||
# run with every deploy (or every time you call after_party:run).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue