Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

186
Visualizações
How to rerun and stop app script based on the execution log info?

I am looking to run below app script with multiple var url such as

https://www.testurl.com/link1=processing

https://www.testurl.com/link2=processing

https://www.testurl.com/link3=processing

How to add multiple url to below code:

function url() {
      var url = 'https://www.testurl.com/link1=processing';
    
      var options = {
        'method': 'get'
      };
      var response = UrlFetchApp.fetch(url, options);
      Logger.log(response);
    }

Each run with single url shows below execution log

3:33:30 AM  Notice  Execution started
3:33:31 AM  Info        {"status":200,"message":"Import 25 of 200 completed."}
3:33:31 AM  Notice  Execution completed

I am looking to rerun script for first url till i get the log message containing "is not triggered" and then run second url and rerun till i get the log message containing "is not triggered" and then run third url and rerun till i get the log message containing "is not triggered" and then stop.

3:33:30 AM  Notice  Execution started
3:33:31 AM  Info        {"status":403,"message":"Import #16 is not triggered. Request skipped."}
3:33:31 AM  Notice  Execution completed
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

There is really no way for me to test this but I think it illustrates how this can be done:

function getUrls() {
  try {
    var urls = [ 'https://www.testurl.com/link1=processing',
                 'https://www.testurl.com/link2=processing',
                 'https://www.testurl.com/link3=processing' ];

    function getUrl(url) {
      var options = { 'method': 'get' };
      var response = UrlFetchApp.fetch(url, options);
      while( response.message.indexOf("is not triggered") < 0 ) {
        Logger.log(response);
        response = UrlFetchApp.fetch(url, options);
      }
    }

    urls.forEach( getUrl );
  }
  catch(err) {
    Logger.log(err);
  }
}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda