For a 声明管道 it is adviced to use the 暂停步骤 in the 选项-部分.
Executes the code inside the block with a determined time out limit.
如果达到时间限制,则为异常
(org.jenkinsci.plugins.workflow. step. FlowInterruptedException)是
抛出,这将导致中止构建(除非它被捕获并且
单位是可选的,但默认为分钟。
timeout(time: 10) // would lead to a timeout of 10 minutes (MINUTES is default value)
timeout(time: 10, unit: 'SECONDS') // a 10 seconds timeout
timeout(time: 10, activity: false, unit: 'MILLISECONDS')