fetch-event-source icon indicating copy to clipboard operation
fetch-event-source copied to clipboard

fix: create a new controller before dispose, cause loop request when …

Open chalecao opened this issue 2 years ago • 0 comments
trafficstars

hi, this is my case.

sometimes, call create before dispose when caught exception, but curRequestController get a new AbortController, so it doesn't work.

async function create() {
  curRequestController = new AbortController();
  try {
    ....
   } catch (err) {
       retryTimer = window.setTimeout(create, interval);
       dispose();
  }

so , i fixed it by use origin curRequestController first:

curRequestController = curRequestController || new AbortController();

chalecao avatar Sep 19 '23 06:09 chalecao