Focal Point
[CLOSED] Preventing daily jobs from running over themselves ...

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/636109282

November 02, 2009, 03:57 PM
awendt
[CLOSED] Preventing daily jobs from running over themselves ...
If I have a scheduled process flow, say, "Job 1." If Job 1 runs every day, and for some reason, it takes a while to run due to database issues, or something malfunctioning, how can I ensure Job 1 does not start running while it is already currently being run?

This message has been edited. Last edited by: Kerry,


Webfocus relase 764
Linux
All mentioned including AHTML
November 03, 2009, 04:37 AM
<JG>
use the same method that most systems use.

Write a lock file and check if it exists or if it contains a certain value.
Then terminate the job if it has the wrong value.

Something like

! STATE d:\temp\lock.lck
-RUN
-IF &RETCODE EQ 0 GOTO ENDJOB;
-*
FILEDEF LOCK DISK d:\temp\lock.lck
-RUN
-WRITE LOCK Y
-*
-* YOUR CODE GOES HERE
-*
!DEL d:\temp\lock.lck
-ENDJOB