diff --git a/app/services/gpo_confirmation_uploader.rb b/app/services/gpo_confirmation_uploader.rb index 91133fe0897..23fb6f37ae2 100644 --- a/app/services/gpo_confirmation_uploader.rb +++ b/app/services/gpo_confirmation_uploader.rb @@ -11,6 +11,7 @@ def run clear_confirmations(confirmations) rescue StandardError => error NewRelic::Agent.notice_error(error) + raise error end private @@ -32,7 +33,7 @@ def clear_confirmations(confirmations) end def remote_path - timestamp = @now.strftime('%Y%m%d') + timestamp = @now.strftime('%Y%m%d-%H%M%S') File.join(IdentityConfig.store.usps_upload_sftp_directory, "batch#{timestamp}.psv") end diff --git a/config/initializers/job_configurations.rb b/config/initializers/job_configurations.rb index cd608de9b38..d60bcc2cc31 100644 --- a/config/initializers/job_configurations.rb +++ b/config/initializers/job_configurations.rb @@ -6,6 +6,7 @@ cron_1h = '0 * * * *' interval_1h = 60 * 60 cron_24h = '0 0 * * *' +gpo_cron_24h = '0 10 * * *' # 10am UTC is 5am EST/6am EDT inteval_24h = 24 * 60 * 60 # Once we enable ruby workers in prod, we can remove all the JobRunner code and config @@ -21,7 +22,7 @@ }, good_job: { class: 'GpoDailyJob', - cron: cron_24h, + cron: gpo_cron_24h, args: -> { [Time.zone.today] }, }, }, diff --git a/spec/services/gpo_confirmation_uploader_spec.rb b/spec/services/gpo_confirmation_uploader_spec.rb index 1449798c3bc..f4b45e0815a 100644 --- a/spec/services/gpo_confirmation_uploader_spec.rb +++ b/spec/services/gpo_confirmation_uploader_spec.rb @@ -98,7 +98,7 @@ expect(NewRelic::Agent).to receive(:notice_error) - expect { subject }.to_not raise_error + expect { subject }.to raise_error expect(GpoConfirmation.count).to eq 1 end @@ -115,7 +115,7 @@ def sftp_options end def upload_folder - timestamp = Time.zone.now.strftime('%Y%m%d') + timestamp = Time.zone.now.strftime('%Y%m%d-%H%M%S') File.join(IdentityConfig.store.usps_upload_sftp_directory, "batch#{timestamp}.psv") end