mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-04-23 18:33:35 +00:00
Post the supervisor api port to the resin api.
This commit is contained in:
parent
c8023e0780
commit
fafef6cc6f
@ -34,6 +34,10 @@ knex.init.then ->
|
||||
|
||||
console.log('Starting API server..')
|
||||
api.listen(config.listenPort)
|
||||
application.updateDeviceInfo(
|
||||
api_port: config.listenPort
|
||||
5000
|
||||
)
|
||||
|
||||
console.log('Starting Apps..')
|
||||
knex('app').select()
|
||||
|
@ -295,7 +295,7 @@ getDeviceID = do ->
|
||||
throw new Error('Could not find this device?!')
|
||||
return devices[0].id
|
||||
|
||||
exports.updateDeviceInfo = updateDeviceInfo = (body) ->
|
||||
exports.updateDeviceInfo = updateDeviceInfo = (body, retry = false) ->
|
||||
Promise.all([
|
||||
knex('config').select('value').where(key: 'apiKey')
|
||||
getDeviceID()
|
||||
@ -309,4 +309,6 @@ exports.updateDeviceInfo = updateDeviceInfo = (body) ->
|
||||
)
|
||||
.catch (error) ->
|
||||
utils.mixpanelTrack('Device info update failure', {error, body})
|
||||
|
||||
if retry isnt false
|
||||
Promise.delay(retry).then ->
|
||||
updateDeviceInfo(body, retry)
|
||||
|
Loading…
x
Reference in New Issue
Block a user