Advertisement
huguesfontenelle

rerun

Jun 16th, 2016
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. ch = Channel.from(1, 2, 3)
  2.  
  3. (chone, chtwo) = ch.into(2)
  4.  
  5. process rerun {
  6. echo true
  7. errorStrategy {task.attempt==1 ? 'retry' : 'ignore'}
  8.  
  9. input:
  10. val(no) from chone
  11.  
  12. script:
  13. """
  14. echo ${no}
  15. set -euf -o pipefail
  16. awk -v min=1 -v max=5 'BEGIN{srand(); print int(min+rand()*(max-min+1))}' | xargs sleep
  17. blurp
  18. """
  19. }
  20.  
  21. process runonce {
  22. echo true
  23. publishDir "success", mode: 'link'
  24.  
  25. input:
  26. val(no) from chtwo
  27.  
  28. output:
  29. file("ok.txt")
  30.  
  31. script:
  32. """
  33. echo ${no}
  34. set -euf -o pipefail
  35. sleep 5
  36. echo "OK" > ok.txt
  37. """
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement