Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-19-2009, 08:50 PM
ktak ktak is online now
Registered User
 
Join Date: 08-31-2009
Posts: 5
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?
Reply With Quote
  #2  
Old 11-19-2009, 10:42 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
http://www.kinook.com/VisBuildPro/Ma...ancesample.htm
Reply With Quote
  #3  
Old 11-25-2009, 02:20 PM
ktak ktak is online now
Registered User
 
Join Date: 08-31-2009
Posts: 5
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?
Reply With Quote
  #4  
Old 11-25-2009, 03:01 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
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]
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 05:53 PM.


Copyright © 1999-2023 Kinook Software, Inc.