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

308
Views
reconexión de la API de extracción de eventSource

He usado eventSourcePolyfill fetch API para eventos enviados por el servidor. Mi problema es que, a pesar de cerrar la conexión desde el front-end, recibe llamadas repetidas veces con un mensaje de error:

 eventsource.js:913 Error: No activity within 45000 milliseconds. No response received. Reconnecting.

Encuentre el código a continuación:

 callSSE(that, uid) { let authHeader = localStorage.getItem('token'); let obj = { Authorization: authHeader, progress_bar_guid: uid, heartbeatTimeout: 600*1000 } this.source = new EventSourcePolyfill("SSE URL", {headers: obj}); this.source.addEventListener('message', function(e: any) { let dt = JSON.parse(e.data); }, false) this.source.addEventListener('open', function(e: any) { if (!e) { if (this.source) this.source.Close(); } console.log('connected!'); }, false) this.source.addEventListener('error', function(e: any) { if (this.source) { this.source.close(); } }, false) this.source.addEventListener("COMPLETE", function(e: any) { let dt = JSON.parse(e.data); if (this.source) { this.source.Close(); //It is not coming here. Because this.source is undefined } }) }

El servidor está enviando el último registro con datos: COMPLETO. En el eventListener COMPLETO, quiero cerrar esta conexión de origen. Pero de alguna manera no se está cerrando.

¡Cualquier ayuda es apreciada!

Gracias,

error en la consola repetir llamada de progreso

about 4 years ago · Juan Pablo Isaza
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!