getWaittime - noetl/noetl GitHub Wiki

E.g. timeInSeconds = getWaittime("5m")

Parameters

  • waittime: String specifying the length and the type (hours, minutes, seconds) of the waittime between re-running steps

Key Variables

  • measure: Measure of time: "h" = hours, "m" = minutes, "s" = seconds
  • timeLength: Integer waittime amount

Functionality

  • getWaittime splits the waittime into two parts: the measure (specifies "h", "m", "s") and the timeLength.
  • If the measure is seconds, getWaittime returns the timeLength, which is already in seconds.
    • If the measure is in minutes, getWaittime returns timeLength*60 to convert it into seconds.
    • If the measure is hours, getWaittime returns the product of timeLength6060, which converts timeLength into seconds.

Except Statement

If an error arises, the except block writes to the log file, recording the time, the waittime, and the error message.

Return Value

Returns the waittime in seconds.