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

240
Views
¿Cómo hacer que la función se ejecute para siempre en el navegador?

Tengo una función simple que obtiene algunos datos, se los muestra al usuario (en un gráfico), espera 10 minutos y comienza de nuevo. Después de un tiempo, aparece este error Error: timeout of 0ms exceeded

Descubrí que se suponía que esto sucedería si no se puede conectar a Internet, lo cual no puede ser el caso.

¿Chrome está haciendo esto tal vez? Creo que podría congelar la aplicación o algo así.

Aquí está la función simple:

 updateReports() { // checks for new data, waits the given time, and checks again.. forever this.$VKS.Read('Report', { filter: { shared: this.user }}) .then(reports => { this.reports = reports // show the data to the user setTimeout(() => { this.updateReports() // start again }, 1000 * 60 * 10) // 10 minutes }).catch(err => console.error(err)) },

¡Gracias por tu ayuda!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

si obtiene un error (en este caso, Timeout ), sus códigos nunca volverán a intentarlo. necesita hacer lo mismo en la instrucción catch:

 updateReports() { // checks for new data, waits the given time, and checks again.. forever this.$VKS.Read('Report', { filter: { shared: this.user }}) .then(reports => { this.reports = reports // show the data to the user setTimeout(() => { this.updateReports() // start again }, 1000 * 60 * 10) // 10 minutes }).catch(err => { console.error(err); setTimeout(() => { this.updateReports() // start again }, 1000 * 60 * 10) // 10 minutes }) },
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!