From c2f935d3d6367123c7d80e8db805a6a86f368cbb Mon Sep 17 00:00:00 2001 From: Matthew Sigley Date: Mon, 19 Sep 2016 13:28:21 -0400 Subject: [PATCH] Removed bad success check in timeout --- mailgun_validator.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/mailgun_validator.js b/mailgun_validator.js index 3bba9f0..a318774 100644 --- a/mailgun_validator.js +++ b/mailgun_validator.js @@ -97,19 +97,17 @@ // timeout incase of some kind of internal server error var timeoutID = setTimeout(function() { error_message = 'Error occurred, unable to validate address.'; - if (!success) { - //Abort existing AJAX Request for a true timeout - if(element.mailgunRequest) { - element.mailgunRequest.abort(); - element.mailgunRequest = null; - } + //Abort existing AJAX Request for a true timeout + if(element.mailgunRequest) { + element.mailgunRequest.abort(); + element.mailgunRequest = null; + } - if (options && options.error) { - options.error(error_message, options.e); - } - else { - if (console) console.log(error_message); - } + if (options && options.error) { + options.error(error_message, options.e); + } + else { + if (console) console.log(error_message); } }, 30000); //30 seconds