03-23-2021, 04:31 PM
Interesting...try this version...it prints out a bunch of debug text to the listener that will hopefully allow us to track down where it's going wrong on your system:
Code:
fn tf_waitForCommandToComplete params timeOutInSec outputFile exitCodeFile =
(
local result = -2
BinDir = systemTools.getEnvVariable( "DEADLINE_PATH" ) + "\\" --we grab the path to the binaries from the Windows Env. variable introduced in Deadline 7
DeadlineExec = BinDir + "deadlinecommand.exe" --this is the deadlinecommand that returns results in memory
DeadlineBGExec = BinDir + "deadlinecommandbg.exe" --this one writes the results to files on disk
print DeadlineExec
if (DoesFileExist(DeadlineExec)) then (print "...found") else (print "...NOT found")
print DeadlineBGExec
if (DoesFileExist(DeadlineBGExec)) then (print "...found") else (print "...NOT found")
theParams = (" -outputfiles \""+outputFile+"\" \""+exitCodeFile+"\" " + params)
print ("Launching command: " + deadlineBGExec as string + " : " + theParams as string )
ShellLaunch DeadlineBGExec theparams
local startTimeStamp = timestamp()
local ready = false
print "\nWaiting for response..."
while not ready do
(
sleep 0.15
if doesFileExist exitCodeFile do
(
local theFile = openFile exitCodeFile
try(result = readValue theFile)catch(result = -2)
try(close theFile)catch()
ready = true
print "...exitCodeFile found"
)
if (timestamp() - startTimeStamp > timeOutInSec*1000) or keyboard.escpressed then
(
result = -3
ready = true
print "...exitCodeFile NOT found within timeout period"
)
)
print ("Result: " + result as string)
return case result of
(
0: #success
(-1): #failed
(-2): #readerror
(-3): #timeout
)
)
fn getDeadlineNetworkRoot =
(
try
(
local submitOutputFile = sysInfo.tempdir + "submitOutput.txt"
local submitExitCodeFile = sysInfo.tempdir + "submitExitCode.txt"
deleteFile submitOutputFile
deleteFile submitExitCodeFile
if (not DoesFileExist(submitExitCodeFile)) then (print "exitCodeFile successfully cleared") else (print "exitCodeFile NOT cleared")
local result = tf_waitForCommandToComplete "-getrepositoryroot" 10 submitOutputFile submitExitCodeFile
print "\n"
if result == #success then
(
local resultFile = OpenFile submitOutputFile
local resultMsg = ""
if (DoesFileExist(submitOutputFile)) then (print "...result file found") else (print "...result file NOT found")
if (resultFile != undefined) do
(
try(resultMsg = readLine resultFile)catch()
try(close resultFile)catch()
)
return resultMsg
)
) catch(print (getcurrentexception()))
undefined
)
clearlistener()
getDeadlineNetworkRoot()