I am using the default service GroupsManager and Group to scan through all groups in a domain, check if a group does not have an owner and in that case set a default owner.
The number of groups in the domain are almost 2000 and this causes me a timeout. I have tried a try/catch statement inside the loop that processes the each group, but Google kills the script on the timeout.
I am happy to do this in batches, but how can I actually continue to execute my script once a timeout has occurred? Or am I supposed to monitor the execution time and use some sort of sleep?
Or do I have to face the reality and restart the script after each timeout.
Really need a response to this, thanks!
/ Don Pedro
You shouldn’t let the script time out but instead try to process a limited number of items at a time on a specific time interval using a timer trigger.
Well I guess you could answer that this is more easily said than done … but it is actually very simple :
Hoping this will give you enough indications to start with.