Guest User

Untitled

a guest
Dec 18th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. var domArray = []
  2. var onQueueDom = []
  3. var onQueueDomStatus = ["N"]
  4. var processedNum = 0
  5.  
  6. function checkIfPending(){
  7.  
  8. console.log('checkIfPending being executed ')
  9.  
  10. setTimeout(function(){
  11. if(onQueueDomStatus[0] == "D"){
  12.  
  13.  
  14.  
  15. console.log("Process Done, returning True")
  16.  
  17. return true
  18.  
  19. console.log("True has been returned, you shouldn't seeing this")
  20.  
  21.  
  22. }
  23. else if(onQueueDomStatus[0] !== "D" || onQueueDomStatus[0] !== "N" && onQueueDom !== ""){
  24. console.log("Still Processing, will re-check in 3 second")
  25.  
  26. return false
  27. }
  28. else {
  29. console.log("No domain on Queue but status not clear")
  30. console.log("Clearing status...")
  31.  
  32. onQueueDomStatus[0] = "D"
  33.  
  34. console.log('setting onQueueDomStatus to ' + onQueueDomStatus[0])
  35.  
  36. console.log("Status changed to D & returning True")
  37.  
  38. return true
  39.  
  40. }
  41. }, 3000);
  42.  
  43. }
  44.  
  45. while(checkIfPending() == true){
  46.  
  47. console.log('while loop is running')
  48.  
  49. onQueueDomStatus[0] = "N"
  50. console.log('setting onQueueDomStatus to ' + onQueueDomStatus[0])
  51.  
  52. movetoQueue()
  53. console.log('Executing movetoQueue')
  54. }
Add Comment
Please, Sign In to add comment