mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-19 13:47:54 +00:00
Bug fix: async's callback was called twice
This commit is contained in:
parent
cb434292bf
commit
3c49f64dbc
@ -52,7 +52,11 @@ class Application
|
|||||||
shouldRestartApp = Boolean(@process)
|
shouldRestartApp = Boolean(@process)
|
||||||
tasks = [
|
tasks = [
|
||||||
# Stop the application if running
|
# Stop the application if running
|
||||||
(callback) => shouldRestartApp and @_stop(callback) or callback()
|
(callback) =>
|
||||||
|
if shouldRestartApp
|
||||||
|
@_stop(callback)
|
||||||
|
else
|
||||||
|
callback()
|
||||||
|
|
||||||
# Pull new commits
|
# Pull new commits
|
||||||
(callback) =>
|
(callback) =>
|
||||||
@ -63,7 +67,11 @@ class Application
|
|||||||
spawn('npm', ['install'], @options).on('exit', callback).on('error', callback)
|
spawn('npm', ['install'], @options).on('exit', callback).on('error', callback)
|
||||||
|
|
||||||
# Start the app
|
# Start the app
|
||||||
(callback) => shouldRestartApp and @_start(callback) or callback()
|
(callback) =>
|
||||||
|
if shouldRestartApp
|
||||||
|
@_start(callback)
|
||||||
|
else
|
||||||
|
callback()
|
||||||
]
|
]
|
||||||
async.series(tasks, callback)
|
async.series(tasks, callback)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user