Guest User

Untitled

a guest
May 23rd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. let monitor = await Service.monitor(session,taskId);
  2. let percent = JSON.parse(monitor).result[0].data.percent;
  3.  
  4. let tryCount = 0;
  5. let tryMax = 10;
  6. while (percent < 100 || tryCount < tryMax) {
  7. setTimeout(function() {
  8. let percent = JSON.parse(monitor).result[0].data.percent;
  9. tryCount++;
  10. }, 5000);
  11.  
  12. console.log('in a while loop ',tryCount, percent);
  13.  
  14. if(tryCount == 10){
  15. var err = new Error('Error')
  16. throw err
  17. }
  18. }
  19.  
  20. in a while loop 0 0
  21. in a while loop 0 0
  22. ...
  23. in a while loop 0 0
  24. in a while loop 0 0
Add Comment
Please, Sign In to add comment