login Signup

Perl API runProcedure does not return value when pollInterval is used

Hey there,

I was trying to use ec-perl to run a procedure and I ran across an issue involving the pollInerval option. If I do a regular runProcedure call with just the project and procedure name, it runs fine and I get a jobId value back from the method. When I use the pollInterval option, the procedure executes and it does wait, however, nothing is returned from the method call - no jobId or anything. As a result, the rest of the script has no clue what job executed and cannot use its jobId for any operations . Operations on the variable that was supposed to store the jobId result in errors that amount to "can't do that 'cause it's null"

Here's my sample code. "Test" is the project name and "echo" is the procedure.

 use ElectricCommander;
 my $cmdr = new ElectricCommander();
 my $xpath = $cmdr->runProcedure("Test", {procedureName => "echo", pollInterval => "2"});
 my $jobId = $xpath->findvalue('//jobId')->value(); ### error because $xpath is null

Thanks for the help!

avatar image By david 131 asked Jan 08, 2014 at 11:58 AM
more ▼
(comments are locked)
10|750 characters needed characters left

1 answer: sort voted first

How long does your procedure take to execute? If the procedure takes more than 60 seconds to complete, the call to runProcedure will time out. --pollinterval in this case will query the procedure every 2 seconds to see if it is finished, but after 60 seconds it will time out. You need to use the --timeout parameter to tell it how much longer than 60 seconds you want it to wait for the desired procedure to complete if that is the case.

avatar image By juan 1.2k answered Mar 06, 2014 at 05:49 PM
more ▼
(comments are locked)
avatar image adkevin Jun 30, 2014 at 03:22 AM

I am seeing the same exact issue as what David has describe. Can any ec folks help with this?

avatar image juan Jun 30, 2014 at 10:40 AM

Did you try the solution given above, to adjust the --timeout parameter?

10|750 characters needed characters left
Your answer
toggle preview:

Up to 8 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.