mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-618: cloudstack UI - API request throttling - for async job action, make frequency of calling queryAsyncJobResult API based on listCapabilities response.
This commit is contained in:
parent
4869f0cacf
commit
06a733a89f
|
|
@ -157,6 +157,13 @@
|
|||
|
||||
g_cloudstackversion = json.listcapabilitiesresponse.capability.cloudstackversion;
|
||||
|
||||
if(json.listcapabilitiesresponse.capability.apilimitinterval != null && json.listcapabilitiesresponse.capability.apilimitmax != null) {
|
||||
var intervalLimit = ((json.listcapabilitiesresponse.capability.apilimitinterval * 1000) / json.listcapabilitiesresponse.capability.apilimitmax ) * 3; //multiply 3 to be on safe side
|
||||
//intervalLimit = 9999; //this line is for testing only, comment it before check in
|
||||
if(intervalLimit > g_queryAsyncJobResultInterval)
|
||||
g_queryAsyncJobResultInterval = intervalLimit;
|
||||
}
|
||||
|
||||
userValid = true;
|
||||
},
|
||||
error: function(xmlHTTP) {
|
||||
|
|
@ -283,7 +290,14 @@
|
|||
$.cookie('userProjectsEnabled', g_userProjectsEnabled, { expires: 1 });
|
||||
|
||||
g_cloudstackversion = json.listcapabilitiesresponse.capability.cloudstackversion;
|
||||
|
||||
|
||||
if(json.listcapabilitiesresponse.capability.apilimitinterval != null && json.listcapabilitiesresponse.capability.apilimitmax != null) {
|
||||
var intervalLimit = ((json.listcapabilitiesresponse.capability.apilimitinterval * 1000) / json.listcapabilitiesresponse.capability.apilimitmax ) * 3; //multiply 3 to be on safe side
|
||||
//intervalLimit = 8888; //this line is for testing only, comment it before check in
|
||||
if(intervalLimit > g_queryAsyncJobResultInterval)
|
||||
g_queryAsyncJobResultInterval = intervalLimit;
|
||||
}
|
||||
|
||||
args.response.success({
|
||||
data: {
|
||||
user: $.extend(true, {}, loginresponse, {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ var g_timezone = null;
|
|||
var g_supportELB = null;
|
||||
var g_userPublicTemplateEnabled = "true";
|
||||
var g_cloudstackversion = null;
|
||||
var g_queryAsyncJobResultInterval = 6000;
|
||||
|
||||
//keyboard keycode
|
||||
var keycode_Enter = 13;
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@
|
|||
$total.parent().addClass('pending');
|
||||
$item.addClass('pending');
|
||||
|
||||
// Setup timer
|
||||
// Setup timer
|
||||
var pollTimer = setInterval(function() {
|
||||
args.poll({
|
||||
_custom: _custom,
|
||||
|
|
@ -281,7 +281,7 @@
|
|||
cloudStack.ui.event.call('addNotification', {
|
||||
section: notification.section,
|
||||
desc: notification.desc,
|
||||
interval: notification.interval ? notification.interval : 5000,
|
||||
interval: notification.interval ? notification.interval : g_queryAsyncJobResultInterval,
|
||||
_custom: notification._custom,
|
||||
poll: function(args) {
|
||||
var complete = args.complete;
|
||||
|
|
|
|||
Loading…
Reference in New Issue