SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
asynchronous job, verify prevoius job not runn

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
asynchronous job, verify prevoius job not runn
Author Message
Jim Malone



Joined: 23 Oct 2000
Posts: 23

Post asynchronous job, verify prevoius job not running Reply with quote

I want to run a job every 10 minutes,
but at times the job could run for 20 or 30 minutes.
How can I ensure that the new job does not start
up again?

Tue Jul 19, 2005 2:16 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7963

Post Re: asynchronous job, verify prevoius job not runn Reply with quote

Convert it to a script type job. Use a global variable that you set/check in the beginning of the script and rest at the end. If the variable is set it means another job instance is running so that the current instance should simply exit without doing anything.
Another solution is to make job synchronous and assign it to a separate dedicated job queue. This will ensure that only one job instance can run at a time.

: I want to run a job every 10 minutes,
: but at times the job could run for 20 or 30 minutes.
: How can I ensure that the new job does not start
: up again?

Tue Jul 19, 2005 3:34 pm View user's profile Send private message
Jim Malone



Joined: 23 Oct 2000
Posts: 23

Post Re: asynchronous job, verify prevoius job not runn Reply with quote

I tried both of these options and what happens is the job stack up so when the
first job finishes then all the other jobs that did not run execute one after the other..

: Convert it to a script type job. Use a global variable that you set/check in
: the beginning of the script and rest at the end. If the variable is set it
: means another job instance is running so that the current instance should
: simply exit without doing anything.
: Another solution is to make job synchronous and assign it to a separate
: dedicated job queue. This will ensure that only one job instance can run
: at a time.

Tue Sep 20, 2005 10:12 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7963

Post Re: asynchronous job, verify prevoius job not runn Reply with quote

That's right. That is exactly what should happen if you use the second method,... and you get only one instance of the job running at a time. If there is nothing to do the job should simply exit without doig really anything. Add "to do" check to the job logic and you should be fine.

If you decide to stick wth the first method, make sure the job is set to run async. Also don't confuse job start-end events in the log with job really doing the work. The log simply indicates that the job wanted to start. However if implemented correctly the job must check the global flag and exit immediatelly after start if it finds another instance of the job already running.

: I tried both of these options and what happens is the job stack up so when
: the
: first job finishes then all the other jobs that did not run execute one after
: the other..

Tue Sep 20, 2005 10:49 am View user's profile Send private message
Jim Malone



Joined: 23 Oct 2000
Posts: 23

Post Re: asynchronous job, verify prevoius job not runn Reply with quote

Let me clariy, I do not want the job to run until the next scheduled time.

: That's right. That is exactly what should happen if you use the second
: method,... and you get only one instance of the job running at a time. If
: there is nothing to do the job should simply exit without doig really
: anything. Add "to do" check to the job logic and you should be
: fine.

: If you decide to stick wth the first method, make sure the job is set to run
: async. Also don't confuse job start-end events in the log with job really
: doing the work. The log simply indicates that the job wanted to start.
: However if implemented correctly the job must check the global flag and
: exit immediatelly after start if it finds another instance of the job
: already running.

Tue Sep 20, 2005 1:09 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7963

Post Re: asynchronous job, verify prevoius job not runn Reply with quote

Use method 1. If you don't want to see job related start/end events in the log, uncheck the logging option and handle logging in the script using LogAddMessageEx. Call this only if the initial check finds no other job instances.

: Let me clariy, I do not want the job to run until the next scheduled time.

Tue Sep 20, 2005 2:55 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.