I recently started occasionally getting server errors from one of my scripts I set to run automatically every half hour. It doesn't happen consistently (sometimes with days between errors, other times just a few hours). It had been running without a hitch for nearly a year up until now, which is why I am surprised it would suddenly start spitting errors. When I checked the logs it says the error that occurred was "DEADLINE_EXCEEDED". I found other posts about similar errors, but none of the ones I found seemed to answer my question (and/or were resultant of problematic code). My code is really simple, so I don't see anything that could possibly be causing problems:
function markArchivedAsRead() {
var threads = GmailApp.search('is:unread -in:inbox -is:snoozed');
GmailApp.markThreadsRead(threads);
if (threads.length == 1) console.log("1 thread marked as read");
else console.log(threads.length + " threads marked read");
}
Is this error something on Google's end?
Thanks!