Add delay option
This commit is contained in:
@@ -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!")
|
||||
|
||||
@@ -285,3 +285,12 @@ inputs:
|
||||
description: Use pre-built image from GitHub registry
|
||||
type: boolean
|
||||
default: yes
|
||||
|
||||
# Time to wait (in seconds) at the end of job
|
||||
# Use this to avoid triggering abuse mechanics on large workflows
|
||||
delay:
|
||||
description: Use this to avoid triggering abuse mechanics on large workflows
|
||||
type: number
|
||||
default: 0
|
||||
min: 0
|
||||
max: 3600
|
||||
Reference in New Issue
Block a user