Close eventstreams upon completion

Previously we were not closing eventSource's upon completion which
lead to stale eventstream calls persisting across a session in the
scaffolder. This calls eventSource.close() properly in order to
clean up an eventStream once we get completion event

Signed-off-by: jrusso1020 <jrusso@brex.com>
This commit is contained in:
jrusso1020
2021-05-03 09:21:55 -06:00
parent 5c3a5306c1
commit 9314a85926
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder': patch
---
Close eventSource upon completion of a scaffolder task
+1
View File
@@ -214,6 +214,7 @@ export class ScaffolderClient implements ScaffolderApi {
subscriber.error(ex);
}
}
eventSource.close();
subscriber.complete();
});
eventSource.addEventListener('error', event => {