Guest User

Untitled

a guest
Apr 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. class NotReadyError(Exception):
  2. """
  3. Custom exception signaling to the Step Function
  4. that it cannot move to the next state. Instead,
  5. the Retry block is triggered, pausing the process.
  6.  
  7. You can pass details about the progress as a
  8. string when initializing it. It will be shown
  9. in the SF console.
  10. """
  11. pass
  12.  
  13. def is_processing_done():
  14. """
  15. Function checking if whatever external work the
  16. pipeline is waiting on has finished already.
  17. """
  18. return False
  19.  
  20. def main(event, context):
  21. if event.get('force'):
  22. return
  23.  
  24. if not is_processing_done():
  25. raise NotReadyError()
Add Comment
Please, Sign In to add comment