Saturday, 24 August 2013

How to avoid "invoked too many times per second" error

How to avoid "invoked too many times per second" error

I made a Google Apps Script, but often I get this error: Script invoked
too many times per second in this Google user account.

This is the script:
function papersControl(tipo, col, prev_cell, quant) {
var cell = 0;
var gender = tipo.split(" ");
if (tipo == col) {
cell = parseInt(prev_cell,10) + parseInt(quant,10);
return cell;
}
if ( (col == "Special Paper") && (gender[0] == "Certificate") &&
(gender[2] != "Voucher") ) {
cell = parseInt(prev_cell,10) + parseInt(quant,10);
return cell;
}
if ( (col == "Special Paper 2") && (gender[0] == "Certificate") &&
(gender[2] == "Vouncher") ) {
cell = parseInt(prev_cell,10) + parseInt(quant,10);
return cell;
}
else
return prev_cell;
}
I'd like to freeze the past recorded values in a cell in order to reduce
the number of "times per second" that the script invokes Google servers,
since I don't need to compute anymore. How can I do this​​?

No comments:

Post a Comment