I have A simple code to copy content from one sheet to other and it was working fine earlier. Suddenly it is taking too much time and failing with error "service
I tried to copy whole google worksheet and run function manually it worked fine. Even scheduling the function also worked fine but when I tried later neither able to run manually, also scheduled trigger is also failing even in new google worksheet with error Service timed out: Spreadsheets (line 6, file "ORB_1")
function ORB_1H() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var currentSheet = ss.getSheetByName('values');
var logSheet = ss.getSheetByName('1HR');
logSheet.clearContents();
var lastRow = logSheet.getLastRow();
logSheet.getRange(lastRow + 1, 1).setValue(new Date()); // insert timestamp
var range = currentSheet.getDataRange();
range.copyTo(logSheet.getRange(lastRow + 2, 1), {contentsOnly: true});
}
Data should be copied automatically as it was working fine earlier.