def setupSchedule()

in app/services/notification/Notifications.scala [59:84]


  def setupSchedule(
      ownerSchdlCron: String
  )(implicit ec: ExecutionContext): Unit = {
    if (amiableConfigProvider.stage == "PROD") {
      scheduler.getContext.put(
        "ScheduledNotificationRunner",
        scheduledNotificationRunner
      )
      scheduler.getContext.put("ExecutionContext", ec)
      val jobDetail = newJob(classOf[NotificationJob])
        .withIdentity(new JobKey("notificationJob"))
        .build()
      val trigger = newTrigger()
        .withIdentity(new TriggerKey("notificationTrigger"))
        .withSchedule(cronSchedule(ownerSchdlCron))
        .build()
      scheduler.scheduleJob(jobDetail, trigger)
      logger.info(
        s"Scheduled owner notification with schedule [$ownerSchdlCron]"
      )
    } else {
      logger.info(
        s"Scheduled notifications disabled in ${amiableConfigProvider.stage}"
      )
    }
  }