Stop the app only after the backup completed

App backup can take a long time or possibly not work at all. For such
cases, do not stop the app or leave it in some errored state.

newConfigJson is the new config to be updated to. This ensures that
the db has correct app info during the update.
This commit is contained in:
Girish Ramakrishnan
2017-10-12 17:46:15 -07:00
parent 61e2878b08
commit ed0879ffcd
6 changed files with 74 additions and 60 deletions

View File

@@ -73,7 +73,8 @@ CREATE TABLE IF NOT EXISTS apps(
// the following fields do not belong here, they can be removed when we use a queue for apptask
lastBackupId VARCHAR(128), // used to pass backupId to restore from to apptask
oldConfigJson TEXT, // used to pass old config for apptask
oldConfigJson TEXT, // used to pass old config for apptask (configure, restore)
newConfigJson TEXT, // used to pass new config for apptask (update)
PRIMARY KEY(id));
@@ -111,6 +112,7 @@ CREATE TABLE IF NOT EXISTS backups(
dependsOn TEXT, /* comma separate list of objects this backup depends on */
state VARCHAR(16) NOT NULL,
restoreConfigJson TEXT, /* JSON including the manifest of the backed up app */
format VARCHAR(16) DEFAULT "tgz",
PRIMARY KEY (id));