Skip to content

Commit

Permalink
fix(electron-updater): MacUpdater — close proxy server after download
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Jun 6, 2017
1 parent 915abc5 commit 39ae0a4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/electron-updater/src/MacUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,13 @@ export class MacUpdater extends AppUpdater {
else if (requestUrl === "/app.zip") {
let errorOccurred = false
response.on("finish", () => {
if (!errorOccurred) {
resolve()
try {
setImmediate(() => server.close())
}
finally {
if (!errorOccurred) {
resolve()
}
}
})
this.proxyUpdateFile(response, fileInfo, error => {
Expand Down

0 comments on commit 39ae0a4

Please sign in to comment.