mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-05-05 18:38:14 +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) ->
|
checkHost = (options) ->
|
||||||
if disableConnectivityCheck or pauseConnectivityCheck
|
if disableConnectivityCheck or pauseConnectivityCheck
|
||||||
return true
|
return true
|
||||||
return networkCheck.checkHost(options)
|
else
|
||||||
|
return networkCheck.checkHost(options)
|
||||||
|
|
||||||
# Custom monitor that uses checkHost function above.
|
# Custom monitor that uses checkHost function above.
|
||||||
customMonitor = (options, fn) ->
|
customMonitor = (options, fn) ->
|
||||||
@ -103,6 +104,8 @@ exports.connectivityCheck = _.once ->
|
|||||||
parsedUrl = url.parse(config.apiEndpoint)
|
parsedUrl = url.parse(config.apiEndpoint)
|
||||||
fs.mkdirAsync(config.vpnStatusPath)
|
fs.mkdirAsync(config.vpnStatusPath)
|
||||||
.then ->
|
.then ->
|
||||||
|
console.log('Creating directory for watching VPN status...')
|
||||||
|
.finally ->
|
||||||
fs.watch(config.vpnStatusPath, vpnStatusInotifyCallback)
|
fs.watch(config.vpnStatusPath, vpnStatusInotifyCallback)
|
||||||
.catch EEXIST, (err) ->
|
.catch EEXIST, (err) ->
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user