Jobs class Run method - VisualCron - Forum

Community forum

terryo
2008-07-09T21:10:12Z
Hello,

What's the correct way to run a job and then disconnect? Here's a snippet of my code:

static void Jobs_EventOnJobAdded(JobClass j)
{
//throw new Exception("The method or operation is not implemented.");

s.Jobs.Run(j.Id);
System.Threading.Thread.Sleep(1000); // job will only run when we do a delay before the disconnect
s.Disconnect();
}

If I take out the delay, the job never runs, do the delay and the job runs. Is there some other event I'm suppose to
wait for before doing the disconnect?

Support
2008-07-09T22:12:30Z
Hi,

this is because Run method was not synchrous. We have changed this behaviour for 4.9.9. and this time the Run function return true or false if the Job was started or not. 4.9.9. will probably be released tomorrow night.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top