Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
531 views
in Technique[技术] by (71.8m points)

Google Services Quota for Telegram Bot (Google Apps Script)

I am not sure if this is the right platform to ask but I have a few questions with regards to Google Services quotas. I'll be running a one-day event that relies heavily on the use of a telegram bot which is operated using GAS. I'm worried that I will exceed my daily quota for Google Services on that day. Hence, I have a couple of questions to ask regarding this:

  1. Does the quota for Document creation apply to PDF creation as well? In particular, I am creating PDFs using .createFile(blob). Does this count towards the 250/day limit?

  2. Is it possible for me to track how many Google Services quotas I am left with for the day? In particular, I would like to keep track of the number of UrlFetchApp.fetch() quotas I am left with since telegram bots rely heavily on this feature.

  3. Is it possible for me to temporarily increase the number of Google Services quotas I have for just one day?

Thank you! Any help is deeply appreciated!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Thank you for your responses! Just to update everyone, I have resolved the issues I have posted here. Please see the responses to the above problems below:

  1. I have been using folder.createFile(Blob) to create PDF files from Google Apps Script and have not encountered an issue with daily quota so far. This is the case even if I generate > 900 of such files within one day. Hence, I have reason to believe that the create Documents quota listed under: https://developers.google.com/apps-script/guides/services/quotas does not apply to the creation of PDF files.

  2. Following Kessy's comment, I have decided to manually record my quota consumption using a simple script. This was achieved by creating a new sheet in my workbook, and updating the sheet every time a fetchURL call is implemented. The script is as follows:

    var log = SpreadsheetApp.openById(logSheet_ssId).getSheetByName("logSheet") var fetch_count = log.getRange(1,1).setValue(log.getRange(1,1).getValue() + 1) var fetch_time = log.getRange(1,2).setValue(new Date())

...where the total number of fetchURL calls is updated in cell (row = 1, col = 1) using fetch_count, with a timestamp in cell (row = 1, col = 2) showing when the last fetchURL was called (fetch_time). This helps me to keep track and manage my fetchURL quotas better.

  1. Following what I did in questions 1 and 2, I realised that there wasn't a need for me to temporarily increase my quotas for my event. As such, I did not look into a solution for question 3.

Hope my findings are useful to those of you who are facing similar issues! Have a good day!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...