Best way to schedule a process to run forever

Hi everyone,

Right now, I am doing a process to scan lots of tables and generate some numbers in real time and provide the data to an integration system. They want to have the real time data with minimum of delay, so I intend to use an infinite loop,like

====

while(1){do things here…}

===

And put it into a batch. Everything is fine except how to smoothly turn down the batch. So, as I am using infinite loop, I am just run the batch once, and this batch is supposed to be running forever(realistically, till we have a code push).

So, when I try to cancel the batch job, the “cancelling” status is there for a very long time, without turning into “Cancelled”, and if this cannot be achieved, the AOS cannot be turned down as the AOS is halted at “Stopping” status, which is very bad.

So, I just want to know if there is a better way to run something forever? I am using batch as I don’t want to block the front end UI and use the batch server to take the load while release other AOS servers in the cluster.

Thank you,

Kwen

I guess the root problem is, as the batch job is always executing, the cancelling is there forever, and AOS cannot be shutdown correctly, problem is still there…

Batch job can be run at regular intervals. If you want real time numbers, then why not divide the tasks & run the batch job again? i.e. Process all the data once, then exit your loop.

If your job takes 10 minutes to complete a full round of execution, then schedule it every 15 minutes. So there will be a 5 minutes gap in between & then the batch job will start execution again.

In case you want to stop the job, then once the execution is complete, you can put it on withhold state rather than cancelling the batch job.

Yes, Krupa, I intend to introduce several minutes to put the batch to rest. The original requirement didn’t want to do that, but right now, I guess I have to. Thank you!