mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-21 22:47:49 +00:00
Start the fs watch after the VPN directory has been created - Use finally and not then
This commit is contained in:
parent
ac545ccc52
commit
7b8ca9fd73
@ -74,7 +74,8 @@ disableConnectivityCheck = false
|
||||
checkHost = (options) ->
|
||||
if disableConnectivityCheck or pauseConnectivityCheck
|
||||
return true
|
||||
return networkCheck.checkHost(options)
|
||||
else
|
||||
return networkCheck.checkHost(options)
|
||||
|
||||
# Custom monitor that uses checkHost function above.
|
||||
customMonitor = (options, fn) ->
|
||||
@ -103,6 +104,8 @@ exports.connectivityCheck = _.once ->
|
||||
parsedUrl = url.parse(config.apiEndpoint)
|
||||
fs.mkdirAsync(config.vpnStatusPath)
|
||||
.then ->
|
||||
console.log('Creating directory for watching VPN status...')
|
||||
.finally ->
|
||||
fs.watch(config.vpnStatusPath, vpnStatusInotifyCallback)
|
||||
.catch EEXIST, (err) ->
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user