Kinook Software Forum

Kinook Software Forum (https://www.kinook.com/Forum/index.php)
-   [VBP] General Discussion (https://www.kinook.com/Forum/forumdisplay.php?f=2)
-   -   Prevent Multiple Builds Running at Same Time (https://www.kinook.com/Forum/showthread.php?t=4304)

ktak 11-19-2009 07:50 PM

Prevent Multiple Builds Running at Same Time
 
As the title says:
If there is a build running already and another instance starts up (lets say from a scheduler), I want the new instance to detect that there is a build running already and exit gracefully.

Is there a global variable that i can use to set conditions?

kinook 11-19-2009 09:42 PM

http://www.kinook.com/VisBuildPro/Ma...ancesample.htm

ktak 11-25-2009 01:20 PM

Looking at the SingleInstance example, I am getting incorrect behavior on the step to clear the "stale marker".

The conditional expression for that step is the following:

[DateDiff("h", Now, vbld_ParseFormattedDateTime(vbld_GetFileContents("E:/scripts/markerfile"))) >1]
(is true)

if the date is over 1 hour it should delete the marker file.


The marker file I am using for this example has this date inside of it:
D20091125T094945

I made sure that the marker file is way older than 1 hour, however the condition didn't evaluate to true.

Afterwards, I entered this line in a run script step to see what dates were getting sent in as parameters for the DateDiff function.

var t = vbld_ParseFormattedDateTime(vbld_GetFileContents("E:/scripts/markerfile"));
Builder.LogMessage(t);

Surprisingly, I got a time stamp off by a month.
"Fri Dec 25 09:49:45 PST 2009"

I checked my machine to make sure the system clock is correct, and it was.

Is this a bug on VBP?

kinook 11-25-2009 02:01 PM

Looks like that should be

[DateDiff("h", vbld_ParseFormattedDateTime(vbld_GetFileContents("E:/scripts/markerfile")), Now) >1]

or

[Abs(DateDiff("h", Now, vbld_ParseFormattedDateTime(vbld_GetFileContents("E:/scripts/markerfile")))) >1]


All times are GMT -5. The time now is 11:47 AM.


Copyright © 1999-2023 Kinook Software, Inc.