Skip to content

Commit

Permalink
Add terminates when the workers close just to be sure
Browse files Browse the repository at this point in the history
  • Loading branch information
tomouchuu committed Oct 9, 2023
1 parent 6813437 commit c41f197
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/five-grapes-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@haishin/backend': patch
---

Add terminates when the workers close just to be sure
2 changes: 2 additions & 0 deletions apps/backend/src/stream/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const setupStream = async (streamUrl: string): Promise<string> => {

restreamerWorker.addEventListener('close', (event) => {
console.log('restreamerWorker is being closed')
restreamerWorker.terminate()
})

const streamFile = await new Promise((resolve) => {
Expand All @@ -48,6 +49,7 @@ export const setupStream = async (streamUrl: string): Promise<string> => {

thumbnailWorker.addEventListener('close', (event) => {
console.log('thumbnailWorker is being closed')
thumbnailWorker.terminate()
})

// Get the first thumbnail
Expand Down
1 change: 1 addition & 0 deletions apps/backend/src/transcriber/splitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const splitter = async (

splitterWorker.addEventListener('close', (event) => {
console.log('splitterWorker is being closed')
splitterWorker.terminate()
})

// Start the splitter, and get the partFileName and duration of this part
Expand Down

0 comments on commit c41f197

Please sign in to comment.