task 584: Add a timeout of 10 seconds for reconciliation service to respond

http://code.google.com/p/google-refine/issues/detail?id=584

git-svn-id: http://google-refine.googlecode.com/svn/trunk@2580 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
Tom Morris 2012-10-12 22:29:53 +00:00
parent 3ff52ba494
commit 12308c2840

View File

@ -75,12 +75,15 @@ ReconciliationManager.registerService = function(service) {
};
ReconciliationManager.registerStandardService = function(url, f) {
var dismissBusy = DialogSystem.showBusy();
var dismissBusy = DialogSystem.showBusy("Contacting reconciliation service...");
$.getJSON(
url + (url.contains("?") ? "&" : "?") + "callback=?",
null,
function(data) {
$.ajax(
url,
{ "dataType" : "jsonp",
"timeout":10000
}
)
.success(function(data, textStatus, jqXHR) {
data.url = url;
data.ui = { "handler" : "ReconStandardServicePanel" };
@ -97,12 +100,10 @@ ReconciliationManager.registerStandardService = function(url, f) {
if (f) {
f(index);
}
},
"jsonp"
)
})
.error(function(jqXHR, textStatus, errorThrown) {
dismissBusy();
alert('Error contacting recon service: '+textStatus + ' : ' + errorThrown);
alert('Error contacting recon service: ' + textStatus + ' : ' + errorThrown + ' - ' + url);
});
};