Copy app creates double apps and timeout errors
QHose opened this issue · 5 comments
QHose commented
hi Stefan,
If I use the code of NPM QRS, I get double apps, and timeout messages. If I just create my own HTTP call it works perfectly. Can you see the issue?
- I don' see double log entries in node, but I do have double apps in Sense...
//CODE WITH NPM QRS, THAT GENERATES DOUBLE APPS
function copyApp (guid, name) {
console.log('Copy template: '+guid+' to new app: '+name);
check(guid, String);
check(name, String);
return qrs.post('/qrs/app/'+guid+'/copy', [{"key": "name", "value": name}])
.then(
function fulfilled (result) {
console.log('result of copy app promise', result);
return result;
},
function Rejected (error){
console.error('Promise Rejected: Error when trying to copy the app', error);
throw new Meteor.Error('App copy failed', 'App copy failed');
})
};
//MY OWN CODE THAT WORKS FINE
function copyApp (guid, name) {
console.log('Copy template: '+guid+' to new app: '+name);
check(guid, String);
check(name, String);
return new Promise(function(resolve, reject){
HTTP.call( 'post', 'http://'+config.host+'/'+config.virtualProxy+'/qrs/app/'+guid+'/copy?name='+name+'&xrfkey='+config.xrfkey,
{
headers: {
'hdr-usr' : config.headerValue,
'X-Qlik-xrfkey': config.xrfkey
}
}, function( error, response ) {
if ( error ) {
console.error( error );
throw new Meteor.Error('error app copy', error)
reject(error);
} else {
console.log( response );
resolve('copy app success');
}
});
})
};
QHose commented
QHose commented
QHose commented
So, this is caused by the fact that i don't throttle my requests to sense qrs
- Could you implement this limiter in your code?
QHose commented
Btw, i noticed you can seriously make sense qmc itself unresponsive by this... Even after my calls finished
stefanwalther commented
I think there is some general timeout handling necessary in this, will investigate as soon as I have time ;-)