Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

TypeError and Wait Timer

$
0
0

Sometimes (but not everytime), my wait time calculation script bombs out with this error:

 

TypeError: Cannot find function SetHours in object Tue Mar 18 2014 14:02:56 GMT-0400 (EDT). (Workflow:Install SQL / Calculate Wait (working) (item11)#17)

 

Any Ideas? (NextPool is used for a WaitTimer)

 

OUT:

NextPoll (Date)

 

SCRIPT:

/* */
var waitTime = 2; // Polling Interval
workflowScheduleDate = new Date(); //this is now
// If minutes is less than 59
if ((workflowScheduleDate.getMinutes() + waitTime) < 59) {  // Then let's add a minute to that  workflowScheduleDate.setMinutes(workflowScheduleDate.getMinutes() + waitTime);
} else {  // we're at 59 minutes already, add a minute (by rolling over to 60, e.g. 0)  workflowScheduleDate.setMinutes(waitTime);  // If hours is less than 23  if (workflowScheduleDate.getHours() < 23) {  // Let's add an hour to that (because we rolled over minutes  workflowScheduleDate.SetHours(workflowScheduleDate.getHours() +1);  } else {  // We need to roll over our day  workflowScheduleDate.setHours(0);  }
}
// Set the Next scheduled time
NextPoll = workflowScheduleDate;
/* */

 

(And if anyone can tell me how to make this post format the script in a nice manner, I'm all ears)

 

EDIT: I realize that this doesn't quite do exactly what I need it to do (the rolling over kinda works, kind of doesn't), you can ignore that for now.

 

Message was edited by: pezhorEL


Viewing all articles
Browse latest Browse all 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>