Add delay option

This commit is contained in:
lowlighter
2021-06-17 23:19:10 +02:00
parent 8e394bf76d
commit 174f2a27dd
2 changed files with 18 additions and 1 deletions

View File

@@ -92,6 +92,7 @@ async function wait(seconds) {
retries,
"retries.delay":retries_delay,
"output.action":_action,
delay,
...config
} = metadata.plugins.core.inputs.action({core})
const q = {...query, ...(_repo ? {repo:_repo} : null), template}
@@ -449,6 +450,13 @@ async function wait(seconds) {
}
}
//Delay
if (delay) {
info.break()
info("Delay before ending job", `${delay}s`)
await new Promise(solve => setTimeout(solve, delay*1000))
}
//Success
info.break()
console.log("Success, thanks for using metrics!")