I need some assistance on how to implement the SingleThreadScheduledExecutor to run the job every 15mins between 8 am to 10 am UK time and then every 1hr throughout the day.
Currently, I have the following Scala code -
val pollingExecutor = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("MyTestScheduledThread"))
pollingExecutor.scheduleWithFixedDelay(new MyRunnableJob(), 0, 15, TimeUnit.MINUTES)
I would make a wrapper around the job that takes care of scheduling:
And then you can just do: