Add missing res.end in scaffolder backend EventStream usage
Signed-off-by: Trevor Hartman <trevorhartman@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder-backend': patch
|
||||
---
|
||||
|
||||
Add missing res.end() in scaffolder backend EventStream usage
|
||||
@@ -311,6 +311,7 @@ export async function createRouter(
|
||||
logger.error(
|
||||
`Received error from event stream when observing taskId '${taskId}', ${error}`,
|
||||
);
|
||||
res.end();
|
||||
},
|
||||
next: ({ events }) => {
|
||||
let shouldUnsubscribe = false;
|
||||
@@ -324,7 +325,10 @@ export async function createRouter(
|
||||
}
|
||||
// res.flush() is only available with the compression middleware
|
||||
res.flush?.();
|
||||
if (shouldUnsubscribe) subscription.unsubscribe();
|
||||
if (shouldUnsubscribe) {
|
||||
subscription.unsubscribe();
|
||||
res.end();
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user