nodio-cli 1.0.10 → 1.0.11
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.
- package/package.json +1 -1
- package/src/server/routes.js +3 -1
- package/src/user/commands.js +2 -2
- package/src/user/index.js +6 -1
package/package.json
CHANGED
package/src/server/routes.js
CHANGED
|
@@ -263,11 +263,13 @@ function buildRoutes(config) {
|
|
|
263
263
|
});
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
+
const relayTasks = await claimPendingRelayTasks(nodeId, 10);
|
|
267
|
+
|
|
266
268
|
res.json({
|
|
267
269
|
ok: true,
|
|
268
270
|
now: new Date().toISOString(),
|
|
269
271
|
replicationTasks: tasksWithSourceUrl,
|
|
270
|
-
relayTasks
|
|
272
|
+
relayTasks
|
|
271
273
|
});
|
|
272
274
|
} catch (error) {
|
|
273
275
|
next(error);
|
package/src/user/commands.js
CHANGED
|
@@ -112,8 +112,8 @@ async function uploadFile(options) {
|
|
|
112
112
|
if (!Number.isFinite(shardSizeMb) || shardSizeMb <= 0) {
|
|
113
113
|
throw new Error('shard-size-mb must be greater than 0');
|
|
114
114
|
}
|
|
115
|
-
if (!Number.isInteger(replicas) || replicas <
|
|
116
|
-
throw new Error('replicas must be an integer >=
|
|
115
|
+
if (!Number.isInteger(replicas) || replicas < 1) {
|
|
116
|
+
throw new Error('replicas must be an integer >= 1');
|
|
117
117
|
}
|
|
118
118
|
if (!Number.isFinite(directTimeoutMs) || directTimeoutMs <= 0) {
|
|
119
119
|
throw new Error('direct-timeout-ms must be greater than 0');
|
package/src/user/index.js
CHANGED
|
@@ -44,6 +44,11 @@ program
|
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
program.parseAsync(process.argv).catch((error) => {
|
|
47
|
-
|
|
47
|
+
const apiErrorMessage = error.response?.data?.error;
|
|
48
|
+
if (apiErrorMessage) {
|
|
49
|
+
console.error('[nodio]', apiErrorMessage);
|
|
50
|
+
} else {
|
|
51
|
+
console.error('[nodio]', error.message);
|
|
52
|
+
}
|
|
48
53
|
process.exit(1);
|
|
49
54
|
});
|