Skip to content

Commit

Permalink
Merge pull request #6 from hidetak/fix-servient-termination-process
Browse files Browse the repository at this point in the history
Fix servient termination process
  • Loading branch information
egekorkan authored Mar 4, 2024
2 parents cb5e033 + 03546b7 commit c93fa84
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions node-red-node-wot/src/servients/servient-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,16 @@ export default class ServientManager {
console.warn("[warn] timeout happend while servient ending. id: " + id)
resolve()
}, 10000) // If it does not end after 10 seconds, it is considered to be finished.
await servientWrapper.endServient()
console.debug("[debug] servient ended. id: " + id)
clearTimeout(timeoutId)
resolve()
try {
await servientWrapper.endServient()
console.debug("[debug] servient ended. id: " + id)
clearTimeout(timeoutId)
resolve()
} catch (err) {
console.debug("[debug] failed to end servient. id: " + id + " error: " + err.toString())
clearTimeout(timeoutId)
reject(err)
}
})
}

Expand Down

0 comments on commit c93fa84

Please sign in to comment.