Skip to content

Commit

Permalink
PI-2657 Set UPW reminder schedule to 10am
Browse files Browse the repository at this point in the history
Also remove unused dryRun flag.
  • Loading branch information
marcus-bcl committed Nov 25, 2024
1 parent 2aff051 commit 2a291e6
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,4 @@ spec:
value: "true"
- name: JOBS_UNPAID-WORK-APPOINTMENT-REMINDERS_PROVIDER
value: "N56"
- name: JOBS_UNPAID-WORK-APPOINTMENT-REMINDERS_DRY-RUN
value: "{{ index .Values "jobs" "unpaid-work-appointment-reminders" "dry-run" }}"
restartPolicy: Never
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ generic-prometheus-alerts:

jobs:
unpaid-work-appointment-reminders:
dry-run: false
schedule: '0 18 * * *' # 6:00pm UTC every day
schedule: '0 10 * * *' # 10am UTC every day
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ generic-prometheus-alerts:

jobs:
unpaid-work-appointment-reminders:
dry-run: false
schedule: '0 18 * * *' # 6:00pm UTC every day
schedule: '0 10 * * *' # 10am UTC every day
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ generic-service:

jobs:
unpaid-work-appointment-reminders:
dry-run: true
schedule: '30 18 * * *' # 6:30pm UTC every day
schedule: '0 10 * * *' # 10am UTC every day
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ import kotlin.system.exitProcess
class UpwAppointmentRemindersJob(
@Value("\${jobs.unpaid-work-appointment-reminders.provider}")
private val providerCode: String,
@Value("\${jobs.unpaid-work-appointment-reminders.dry-run:false}")
private val dryRun: Boolean,
private val service: UnpaidWorkAppointmentsService,
private val applicationContext: ApplicationContext,
) : ApplicationListener<ApplicationStartedEvent> {
override fun onApplicationEvent(applicationStartedEvent: ApplicationStartedEvent) {
service.sendUnpaidWorkAppointmentReminders(providerCode, dryRun)
service.sendUnpaidWorkAppointmentReminders(providerCode)
exitProcess(exit(applicationContext, { 0 }))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class UnpaidWorkAppointmentsService(
private val telemetryService: TelemetryService,
@Value("\${govuk-notify.templates.upw-appointment-reminder}") private val templateId: String,
) {
fun sendUnpaidWorkAppointmentReminders(providerCode: String, dryRun: Boolean = false) {
upwAppointmentRepository.getUnpaidWorkAppointments(LocalDate.now().plusDays(3), providerCode)
fun sendUnpaidWorkAppointmentReminders(providerCode: String) {
upwAppointmentRepository.getUnpaidWorkAppointments(LocalDate.now().plusDays(2), providerCode)
.forEach {
notificationClient.sendSms(
templateId,
Expand Down

0 comments on commit 2a291e6

Please sign in to comment.