Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

64
Views
¿Por qué este LockService no impide que invoque el servicio GmailApp?

Estoy tratando de obtener el bloqueo durante 5 segundos y trato de ejecutarlo simultáneamente y arroja el error conocido: Exception: Service invoked too many times for one day: email.

Así es como estoy tratando de conseguirlo:

 function sendEmail() { const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getActiveSheet(); if (sheet.getName() != 'Todays Tests V2') { return; } const testSheet = ss.getSheetByName("Todays Tests V2"); const row = sheet.getActiveCell().getRow(); const col = sheet.getActiveCell().getColumn(); const sendResults = testSheet.getRange(row, 15, 1, 1).getValue(); if (ss.getActiveSheet().getSheetName() == testSheet.getSheetName() && row > 5 && col == 15 && sendResults == true) { const lock = LockService.getScriptLock(); try { lock.tryLock(5000); // wait 05 seconds for others' use of the code section and lock to stop and then proceed } catch (e) { Logger.log('Could not obtain lock after 05 seconds.'); return HtmlService.createHtmlOutput("<b> Server Busy. Please try after some time <p>"); } const email = testSheet.getRange(row, 5).getValue(); const name = testSheet.getRange(row, 3).getValue() + ' ' + testSheet.getRange(row, 4).getValue(); const testNo = testSheet.getRange(row, 2).getValue(); GmailApp.sendEmail(email, "subject", name + " XXXXXX.", { name: 'Custom Name' }); lock.releaseLock(); } }
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Intente usar una cuenta diferente o espere 1 día.

Lo anterior porque el mensaje de error significa que la cuenta que estás usando actualmente ha excedido la cuota referida.

about 4 years ago · Juan Pablo Isaza Report

0

Puede revisar los límites aquí: https://developers.google.com/apps-script/guides/services/quotas

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!