bootstrap: if offlineMode is enabled, persist only the uuid

If we don't persist the uuid then every time the supervisor starts it
will think it's a new device. This triggers a wipe of the local state
and also a re-load of the preloaded apps. This in turn causes multiple
instances of the preloaded apps to be left running.

Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
This commit is contained in:
Petros Angelatos 2016-08-02 22:29:24 -07:00
parent d6a7608374
commit dd06f993ce

View File

@ -111,7 +111,10 @@ bootstrapper.startBootstrapping = ->
readConfigAndEnsureUUID()
.tap ->
loadPreloadedApps()
.tap ->
bootstrapOrRetry()
.tap (uuid) ->
if bootstrapper.offlineMode
return knex('config').insert({ key: 'uuid', value: uuid })
else
return bootstrapOrRetry()
module.exports = bootstrapper