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

225
Views
Event Source timeout in 45 seconds

I am working on eventSource where I get percentage from backend. To implement that I have used Event source pollyfill

My problem is backend is taking some time(2 to 3 mins) to respond. But at the front end the eventSource API is failing stating -

No activity within 45000 milliseconds. Reconnecting

To fix that I tried this solution. But no matter what changes I make in eventSource.js in node_modules they are not reflecting.

Can somebody please look.

Thanks in advance!

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

0

Set options.hearbeatTimeout to a very large number. E.g. 10 * 60 * 1000 would make it 10 minutes. (The 45000 is just the default.)

To show it is possible, I found an example for doing that in Vue here: https://github.com/tserkov/vue-sse/issues/35#issuecomment-986807802


BTW, there should be no need to hack the source, when an option is already supplied. I've had mixed luck modifying the files in node_modules - they risk getting replaced without notice. Better is to make a branch on github, modify it there, and change your entry in package.json to link to that:

"the_package": "github:YourName/the_package#master",
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!