#1
|
|||
|
|||
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? |
#2
|
|||
|
|||
#3
|
|||
|
|||
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? |
#4
|
|||
|
|||
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] |
|
|