SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Time scheduling

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Time scheduling
Author Message
Bob Shaw



Joined: 16 Feb 2000
Posts: 2

Post Time scheduling Reply with quote

Hello,
I have question regarding scheduling, and how to set the properties on jobs. I am currently using 1.6.3. I played with the v2.0 beta version a little, and I believe problem will still be an issue.

Senario: I have a series of jobs that need to run on the hour, and on every half hour from 9 AM to 8 PM (i.e. 9, 9:30, 10, 10:30,...etc.)
The job runs anywhere from 3-10 minutes depending on what it finds for data...
I reviewed your example for running a job from 9 - 5, and I have written a script to handle the job times, but I am confused on what the job properties should be.....

What is the behavior of the job if it is marked "asynchronous"? Will the job be invoked every minute if I set the time interval to 1 minute? Remember the job itself will run 3-10 minutes, my concern is that an "asyncronous" job will be started at "31", "32", "33" minutes..etc. that will interfere while the original job at "30" minutes is running. I need to have the process start at the specific times, so I need to have the 1 minute interval. I can't really set the job to "synchronous" because I have other jobs that will need to be
started if the hour/half-hour job is running long (I have other jobs that start at 5 past the hour, also having strict time requirements). Being unable to set the job as "synchronous" eliminates the possibility of using the "jobmod" function.

Any comments / suggestions?

As an idea to get around this.. Is it possible to have function that will wait for a specific time? Something like WaitTime(timetowaitfor) where "timetowaitfor" is a "time" data type? In the new version, it appears that I can specify/create my own functions. Is this a case where this user defined functions would help?

Thanks, Bob


Wed Feb 16, 2000 3:26 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7839

Post Re: Time scheduling Reply with quote

"asynchronous" means that job runs in the background and other jobs will not wait for it to complete. If such job takes 10 minutes to run and the time interval (perhaps you set up it as an "all day" schedule) is 1 minute then you may end up with multiple instances of this job running simultaneously.

There are multiple workarounds for this situation. Just one of them:
Use a global boolean variable in your job, let's call it GLOBAL.RUNNING. On start, the job should check the GLOBAL.RUNNING variable and if it is set to TRUE simply exit becuase another instance is already running, otherwise set it to TRUE and continue running. At the of the run if should reset the variable to FALSE. This way even an asynchronous job can be guaranteed to run just one at a time.

As for the "WaitTime(timetowaitfor)", you can make an user-defined statement like the following:

Dim seconds_left, number
Dim dt_now, datetime
Dim time_now, time
Dim date_now, date
Dim is_negative, boolean

// get datetime now
Today(date_now)
Now(time_now)
DateTimeDiff(timetowaitfor, dt_now, seconds_left)

isLess(seconds_left, 0, is_negative)

// If dt_now occurs before timetowaitfor, DateTimeDiff returns a negative
// number, otherwise we already passed that time (probably a logical error)
ifThen(is_negative, WAIT)
Exit

WAIT:
Wait(seconds_left)

: Hello,
: I have question regarding scheduling, and how to set the properties on jobs.
: I am currently using 1.6.3. I played with the v2.0 beta version a little,
: and I believe problem will still be an issue.

: Senario: I have a series of jobs that need to run on the hour, and on every
: half hour from 9 AM to 8 PM (i.e. 9, 9:30, 10, 10:30,...etc.)
: The job runs anywhere from 3-10 minutes depending on what it finds for
: data...
: I reviewed your example for running a job from 9 - 5, and I have written a
: script to handle the job times, but I am confused on what the job
: properties should be.....

: What is the behavior of the job if it is marked "asynchronous"?
: Will the job be invoked every minute if I set the time interval to 1
: minute? Remember the job itself will run 3-10 minutes, my concern is that
: an "asyncronous" job will be started at "31",
: "32", "33" minutes..etc. that will interfere while the
: original job at "30" minutes is running. I need to have the
: process start at the specific times, so I need to have the 1 minute
: interval. I can't really set the job to "synchronous" because I
: have other jobs that will need to be
: started if the hour/half-hour job is running long (I have other jobs that
: start at 5 past the hour, also having strict time requirements). Being
: unable to set the job as "synchronous" eliminates the
: possibility of using the "jobmod" function.

: Any comments / suggestions?

: As an idea to get around this.. Is it possible to have function that will
: wait for a specific time? Something like WaitTime(timetowaitfor) where
: "timetowaitfor" is a "time" data type? In the new
: version, it appears that I can specify/create my own functions. Is this a
: case where this user defined functions would help?

: Thanks, Bob

Wed Feb 16, 2000 5:32 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.