【发布时间】:2021-04-13 13:50:02
【问题描述】:
我刚刚运行了来自 Apps 脚本教程的示例代码:
https://developers.google.com/apps-script/reference/groups/group#getGroups()
(我已将循环部分注释掉以使问题清晰。)
function listGroupMembers() {
var GROUP_EMAIL = "a-group@in.mydomain";
var group = GroupsApp.getGroupByEmail(GROUP_EMAIL);
Utilities.sleep(10000);
var childGroups = group.getGroups();
console.log("Group " + GROUP_EMAIL + " has " + childGroup.length + " groups:");
/* comment out the loop to make the problem clear.
for (var i = 0; i < childGroups.length; i++) {
var childGroup = childGroups[i];
console.log(childGroup.getEmail());
}
*/
}
但我不断收到以下异常:
Exception: Service invoked too many times in a short time: groups read. Try Utilities.sleep(1000) between calls.
listGroupMembers @ test.gs:6
即使我在过去 24 小时内第一次运行脚本,我也会收到此异常。有什么建议吗?
【问题讨论】:
标签: google-apps-script google-groups google-groups-api