Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var domArray = []
- var onQueueDom = []
- var onQueueDomStatus = ["N"]
- var processedNum = 0
- function checkIfPending(){
- console.log('checkIfPending being executed ')
- setTimeout(function(){
- if(onQueueDomStatus[0] == "D"){
- console.log("Process Done, returning True")
- return true
- console.log("True has been returned, you shouldn't seeing this")
- }
- else if(onQueueDomStatus[0] !== "D" || onQueueDomStatus[0] !== "N" && onQueueDom !== ""){
- console.log("Still Processing, will re-check in 3 second")
- return false
- }
- else {
- console.log("No domain on Queue but status not clear")
- console.log("Clearing status...")
- onQueueDomStatus[0] = "D"
- console.log('setting onQueueDomStatus to ' + onQueueDomStatus[0])
- console.log("Status changed to D & returning True")
- return true
- }
- }, 3000);
- }
- while(checkIfPending() == true){
- console.log('while loop is running')
- onQueueDomStatus[0] = "N"
- console.log('setting onQueueDomStatus to ' + onQueueDomStatus[0])
- movetoQueue()
- console.log('Executing movetoQueue')
- }
Add Comment
Please, Sign In to add comment