Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ch = Channel.from(1, 2, 3)
- (chone, chtwo) = ch.into(2)
- process rerun {
- echo true
- errorStrategy {task.attempt==1 ? 'retry' : 'ignore'}
- input:
- val(no) from chone
- script:
- """
- echo ${no}
- set -euf -o pipefail
- awk -v min=1 -v max=5 'BEGIN{srand(); print int(min+rand()*(max-min+1))}' | xargs sleep
- blurp
- """
- }
- process runonce {
- echo true
- publishDir "success", mode: 'link'
- input:
- val(no) from chtwo
- output:
- file("ok.txt")
- script:
- """
- echo ${no}
- set -euf -o pipefail
- sleep 5
- echo "OK" > ok.txt
- """
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement