@abtnode/core 1.16.14-beta-dd4f6a50 → 1.16.14-beta-a90ba909

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3246,6 +3246,13 @@ class DiskBlockletManager extends BaseBlockletManager {
3246
3246
  appDid,
3247
3247
  meta: { did: appPid },
3248
3248
  } = blocklet;
3249
+
3250
+ const exist = await this.backupQueue.get(appDid);
3251
+
3252
+ if (exist) {
3253
+ throw new Error('A backup for this app is already in progress, abort!');
3254
+ }
3255
+
3249
3256
  const endpoint = getBackupEndpoint(blocklet.environments);
3250
3257
 
3251
3258
  const backup = await states.backup.start({
@@ -3267,6 +3274,8 @@ class DiskBlockletManager extends BaseBlockletManager {
3267
3274
  },
3268
3275
  appDid
3269
3276
  );
3277
+
3278
+ return blocklet;
3270
3279
  } catch (error) {
3271
3280
  logger.error(error);
3272
3281
  throw error;
@@ -3282,6 +3291,8 @@ class DiskBlockletManager extends BaseBlockletManager {
3282
3291
 
3283
3292
  const diskBackup = new DiskBackup({ appDid, event: this });
3284
3293
  await diskBackup.backup();
3294
+
3295
+ return blocklet;
3285
3296
  }
3286
3297
 
3287
3298
  /**
@@ -108,7 +108,7 @@ const getLogContent = async (action, args, context, result, info, node) => {
108
108
  case 'deleteBlocklet':
109
109
  return `removed application ${result.meta.title}`; // prettier-ignore
110
110
  case 'backupBlocklet':
111
- return `backup application ${result.meta.title}`; // prettier-ignore
111
+ return `backup application ${result.meta.title} to ${args.to}`; // prettier-ignore
112
112
  case 'startBlocklet':
113
113
  return `started ${componentOrApplicationInfo(result, args.componentDids)}`;
114
114
  case 'restartBlocklet':
@@ -124,7 +124,7 @@ class BackupState extends BaseState {
124
124
  * @return {Promise<Array<import('@abtnode/models').BackupState>>}
125
125
  */
126
126
  getBlockletBackups({ did }) {
127
- return this.find({ appPid: did }, {}, { updatedAt: -1 });
127
+ return this.find({ appPid: did }, {}, { createdAt: -1 });
128
128
  }
129
129
  }
130
130
 
@@ -8,6 +8,8 @@ const validateBackupStart = Joi.object({
8
8
  sourceUrl: Joi.string().required(),
9
9
  target: Joi.string().valid('Spaces', 'Local').optional().default('Spaces'),
10
10
  targetName: Joi.string().required(),
11
+
12
+ updatedAt: Joi.string().optional().allow(null).default(null),
11
13
  });
12
14
 
13
15
  const validateBackupSuccess = Joi.object({
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.14-beta-dd4f6a50",
6
+ "version": "1.16.14-beta-a90ba909",
7
7
  "description": "",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -19,19 +19,19 @@
19
19
  "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
20
20
  "license": "Apache-2.0",
21
21
  "dependencies": {
22
- "@abtnode/analytics": "1.16.14-beta-dd4f6a50",
23
- "@abtnode/auth": "1.16.14-beta-dd4f6a50",
24
- "@abtnode/certificate-manager": "1.16.14-beta-dd4f6a50",
25
- "@abtnode/constant": "1.16.14-beta-dd4f6a50",
26
- "@abtnode/cron": "1.16.14-beta-dd4f6a50",
27
- "@abtnode/logger": "1.16.14-beta-dd4f6a50",
28
- "@abtnode/models": "1.16.14-beta-dd4f6a50",
29
- "@abtnode/queue": "1.16.14-beta-dd4f6a50",
30
- "@abtnode/rbac": "1.16.14-beta-dd4f6a50",
31
- "@abtnode/router-provider": "1.16.14-beta-dd4f6a50",
32
- "@abtnode/static-server": "1.16.14-beta-dd4f6a50",
33
- "@abtnode/timemachine": "1.16.14-beta-dd4f6a50",
34
- "@abtnode/util": "1.16.14-beta-dd4f6a50",
22
+ "@abtnode/analytics": "1.16.14-beta-a90ba909",
23
+ "@abtnode/auth": "1.16.14-beta-a90ba909",
24
+ "@abtnode/certificate-manager": "1.16.14-beta-a90ba909",
25
+ "@abtnode/constant": "1.16.14-beta-a90ba909",
26
+ "@abtnode/cron": "1.16.14-beta-a90ba909",
27
+ "@abtnode/logger": "1.16.14-beta-a90ba909",
28
+ "@abtnode/models": "1.16.14-beta-a90ba909",
29
+ "@abtnode/queue": "1.16.14-beta-a90ba909",
30
+ "@abtnode/rbac": "1.16.14-beta-a90ba909",
31
+ "@abtnode/router-provider": "1.16.14-beta-a90ba909",
32
+ "@abtnode/static-server": "1.16.14-beta-a90ba909",
33
+ "@abtnode/timemachine": "1.16.14-beta-a90ba909",
34
+ "@abtnode/util": "1.16.14-beta-a90ba909",
35
35
  "@arcblock/did": "1.18.87",
36
36
  "@arcblock/did-auth": "1.18.87",
37
37
  "@arcblock/did-ext": "^1.18.87",
@@ -42,11 +42,11 @@
42
42
  "@arcblock/pm2-events": "^0.0.5",
43
43
  "@arcblock/validator": "^1.18.87",
44
44
  "@arcblock/vc": "1.18.87",
45
- "@blocklet/constant": "1.16.14-beta-dd4f6a50",
46
- "@blocklet/meta": "1.16.14-beta-dd4f6a50",
47
- "@blocklet/resolver": "1.16.14-beta-dd4f6a50",
48
- "@blocklet/sdk": "1.16.14-beta-dd4f6a50",
49
- "@did-space/client": "^0.2.129",
45
+ "@blocklet/constant": "1.16.14-beta-a90ba909",
46
+ "@blocklet/meta": "1.16.14-beta-a90ba909",
47
+ "@blocklet/resolver": "1.16.14-beta-a90ba909",
48
+ "@blocklet/sdk": "1.16.14-beta-a90ba909",
49
+ "@did-space/client": "^0.2.141",
50
50
  "@fidm/x509": "^1.2.1",
51
51
  "@ocap/mcrypto": "1.18.87",
52
52
  "@ocap/util": "1.18.87",
@@ -99,5 +99,5 @@
99
99
  "jest": "^27.5.1",
100
100
  "unzipper": "^0.10.11"
101
101
  },
102
- "gitHead": "fb3858f842b221f0a8c298307b393d55c555af45"
102
+ "gitHead": "a59c9970f447462db0ccfee75b277e98bb11a6fa"
103
103
  }