@filen/sync 0.1.3 → 0.1.4
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/dist/index.d.ts +5 -12
- package/dist/index.js +12 -11
- package/dist/index.js.map +1 -1
- package/dist/lib/deltas.js +141 -40
- package/dist/lib/deltas.js.map +1 -1
- package/dist/lib/filesystems/local.d.ts +8 -24
- package/dist/lib/filesystems/local.js +198 -69
- package/dist/lib/filesystems/local.js.map +1 -1
- package/dist/lib/filesystems/remote.d.ts +4 -1
- package/dist/lib/filesystems/remote.js +141 -51
- package/dist/lib/filesystems/remote.js.map +1 -1
- package/dist/lib/ipc.js +4 -0
- package/dist/lib/ipc.js.map +1 -1
- package/dist/lib/lock.d.ts +13 -0
- package/dist/lib/lock.js +73 -0
- package/dist/lib/lock.js.map +1 -0
- package/dist/lib/state.js +91 -59
- package/dist/lib/state.js.map +1 -1
- package/dist/lib/sync.d.ts +7 -1
- package/dist/lib/sync.js +160 -47
- package/dist/lib/sync.js.map +1 -1
- package/dist/lib/tasks.d.ts +11 -9
- package/dist/lib/tasks.js +368 -42
- package/dist/lib/tasks.js.map +1 -1
- package/dist/types.d.ts +201 -36
- package/dist/utils.d.ts +18 -0
- package/dist/utils.js +43 -11
- package/dist/utils.js.map +1 -1
- package/index.d.ts +9 -0
- package/jest.config.js +5 -0
- package/package.json +5 -3
- package/tests/utils.test.ts +33 -0
- package/tsconfig.json +2 -2
package/dist/lib/tasks.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type Sync from "./sync";
|
|
3
3
|
import { type Delta } from "./deltas";
|
|
4
|
-
import { type
|
|
4
|
+
import { type RemoteItem } from "./filesystems/remote";
|
|
5
5
|
import fs from "fs-extra";
|
|
6
6
|
export type TaskError = {
|
|
7
7
|
path: string;
|
|
@@ -12,13 +12,16 @@ export type DoneTask = {
|
|
|
12
12
|
path: string;
|
|
13
13
|
} & ({
|
|
14
14
|
type: "uploadFile";
|
|
15
|
-
item:
|
|
15
|
+
item: RemoteItem;
|
|
16
|
+
stats: fs.Stats;
|
|
16
17
|
} | {
|
|
17
18
|
type: "createRemoteDirectory";
|
|
18
|
-
|
|
19
|
+
item: RemoteItem;
|
|
20
|
+
stats: fs.Stats;
|
|
19
21
|
} | {
|
|
20
22
|
type: "createLocalDirectory";
|
|
21
23
|
stats: fs.Stats;
|
|
24
|
+
item: RemoteItem;
|
|
22
25
|
} | {
|
|
23
26
|
type: "deleteLocalFile";
|
|
24
27
|
} | {
|
|
@@ -30,6 +33,7 @@ export type DoneTask = {
|
|
|
30
33
|
} | {
|
|
31
34
|
type: "downloadFile";
|
|
32
35
|
stats: fs.Stats;
|
|
36
|
+
item: RemoteItem;
|
|
33
37
|
} | {
|
|
34
38
|
type: "renameLocalFile";
|
|
35
39
|
from: string;
|
|
@@ -59,7 +63,7 @@ export type DoneTask = {
|
|
|
59
63
|
*/
|
|
60
64
|
export declare class Tasks {
|
|
61
65
|
private readonly sync;
|
|
62
|
-
private readonly
|
|
66
|
+
private readonly transfersSemaphore;
|
|
63
67
|
/**
|
|
64
68
|
* Creates an instance of Tasks.
|
|
65
69
|
*
|
|
@@ -69,14 +73,12 @@ export declare class Tasks {
|
|
|
69
73
|
*/
|
|
70
74
|
constructor(sync: Sync);
|
|
71
75
|
/**
|
|
72
|
-
* Process a task.
|
|
73
|
-
* @date 3/2/2024 - 12:14:48 PM
|
|
76
|
+
* Process a delta task.
|
|
74
77
|
*
|
|
75
78
|
* @private
|
|
76
79
|
* @async
|
|
77
|
-
* @param {
|
|
78
|
-
* @
|
|
79
|
-
* @returns {Promise<DoneTask>}
|
|
80
|
+
* @param {Delta} delta
|
|
81
|
+
* @returns {Promise<DoneTask | null>}
|
|
80
82
|
*/
|
|
81
83
|
private processTask;
|
|
82
84
|
/**
|
package/dist/lib/tasks.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.Tasks = void 0;
|
|
4
7
|
const utils_1 = require("../utils");
|
|
8
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
|
+
const ipc_1 = require("./ipc");
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
5
11
|
const semaphore_1 = require("../semaphore");
|
|
6
12
|
/**
|
|
7
13
|
* Tasks
|
|
@@ -20,62 +26,288 @@ class Tasks {
|
|
|
20
26
|
* @param {Sync} sync
|
|
21
27
|
*/
|
|
22
28
|
constructor(sync) {
|
|
23
|
-
this.
|
|
29
|
+
this.transfersSemaphore = new semaphore_1.Semaphore(32);
|
|
24
30
|
this.sync = sync;
|
|
25
31
|
}
|
|
26
32
|
/**
|
|
27
|
-
* Process a task.
|
|
28
|
-
* @date 3/2/2024 - 12:14:48 PM
|
|
33
|
+
* Process a delta task.
|
|
29
34
|
*
|
|
30
35
|
* @private
|
|
31
36
|
* @async
|
|
32
|
-
* @param {
|
|
33
|
-
* @
|
|
34
|
-
* @returns {Promise<DoneTask>}
|
|
37
|
+
* @param {Delta} delta
|
|
38
|
+
* @returns {Promise<DoneTask | null>}
|
|
35
39
|
*/
|
|
36
|
-
async processTask(
|
|
40
|
+
async processTask(delta) {
|
|
37
41
|
switch (delta.type) {
|
|
38
42
|
case "createLocalDirectory": {
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
try {
|
|
44
|
+
const stats = await this.sync.localFileSystem.mkdir({ relativePath: delta.path });
|
|
45
|
+
const item = this.sync.remoteFileSystem.getDirectoryTreeCache.tree[delta.path];
|
|
46
|
+
if (!item) {
|
|
47
|
+
throw new Error("createLocalDirectory: remoteItem not found in getDirectoryTreeCache.");
|
|
48
|
+
}
|
|
49
|
+
(0, ipc_1.postMessageToMain)({
|
|
50
|
+
type: "transfer",
|
|
51
|
+
syncPair: this.sync.syncPair,
|
|
52
|
+
data: {
|
|
53
|
+
of: delta.type,
|
|
54
|
+
type: "success",
|
|
55
|
+
relativePath: delta.path,
|
|
56
|
+
localPath: path_1.default.join(this.sync.syncPair.localPath, delta.path)
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return Object.assign(Object.assign({}, delta), { stats,
|
|
60
|
+
item });
|
|
61
|
+
}
|
|
62
|
+
catch (e) {
|
|
63
|
+
if (e instanceof Error) {
|
|
64
|
+
(0, ipc_1.postMessageToMain)({
|
|
65
|
+
type: "transfer",
|
|
66
|
+
syncPair: this.sync.syncPair,
|
|
67
|
+
data: {
|
|
68
|
+
of: delta.type,
|
|
69
|
+
type: "error",
|
|
70
|
+
relativePath: delta.path,
|
|
71
|
+
localPath: path_1.default.join(this.sync.syncPair.localPath, delta.path),
|
|
72
|
+
error: (0, utils_1.serializeError)(e)
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
throw e;
|
|
77
|
+
}
|
|
41
78
|
}
|
|
42
79
|
case "createRemoteDirectory": {
|
|
43
|
-
|
|
44
|
-
|
|
80
|
+
try {
|
|
81
|
+
const [, stats] = await Promise.all([
|
|
82
|
+
this.sync.remoteFileSystem.mkdir({ relativePath: delta.path }),
|
|
83
|
+
fs_extra_1.default.stat(path_1.default.join(this.sync.syncPair.localPath, delta.path))
|
|
84
|
+
]);
|
|
85
|
+
const item = this.sync.remoteFileSystem.getDirectoryTreeCache.tree[delta.path];
|
|
86
|
+
if (!item) {
|
|
87
|
+
throw new Error("createLocalDirectory: remoteItem not found in getDirectoryTreeCache.");
|
|
88
|
+
}
|
|
89
|
+
(0, ipc_1.postMessageToMain)({
|
|
90
|
+
type: "transfer",
|
|
91
|
+
syncPair: this.sync.syncPair,
|
|
92
|
+
data: {
|
|
93
|
+
of: delta.type,
|
|
94
|
+
type: "success",
|
|
95
|
+
relativePath: delta.path,
|
|
96
|
+
localPath: path_1.default.join(this.sync.syncPair.localPath, delta.path)
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
return Object.assign(Object.assign({}, delta), { item,
|
|
100
|
+
stats });
|
|
101
|
+
}
|
|
102
|
+
catch (e) {
|
|
103
|
+
if (e instanceof Error) {
|
|
104
|
+
(0, ipc_1.postMessageToMain)({
|
|
105
|
+
type: "transfer",
|
|
106
|
+
syncPair: this.sync.syncPair,
|
|
107
|
+
data: {
|
|
108
|
+
of: delta.type,
|
|
109
|
+
type: "error",
|
|
110
|
+
relativePath: delta.path,
|
|
111
|
+
localPath: path_1.default.join(this.sync.syncPair.localPath, delta.path),
|
|
112
|
+
error: (0, utils_1.serializeError)(e)
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
throw e;
|
|
117
|
+
}
|
|
45
118
|
}
|
|
46
119
|
case "deleteLocalDirectory":
|
|
47
120
|
case "deleteLocalFile": {
|
|
48
|
-
|
|
49
|
-
|
|
121
|
+
try {
|
|
122
|
+
await this.sync.localFileSystem.unlink({ relativePath: delta.path });
|
|
123
|
+
(0, ipc_1.postMessageToMain)({
|
|
124
|
+
type: "transfer",
|
|
125
|
+
syncPair: this.sync.syncPair,
|
|
126
|
+
data: {
|
|
127
|
+
of: delta.type,
|
|
128
|
+
type: "success",
|
|
129
|
+
relativePath: delta.path,
|
|
130
|
+
localPath: path_1.default.join(this.sync.syncPair.localPath, delta.path)
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
return delta;
|
|
134
|
+
}
|
|
135
|
+
catch (e) {
|
|
136
|
+
// Don't throw if the file/directory does not exist anymore.
|
|
137
|
+
if (!(await this.sync.localFileSystem.pathExists(delta.path))) {
|
|
138
|
+
return delta;
|
|
139
|
+
}
|
|
140
|
+
if (e instanceof Error) {
|
|
141
|
+
(0, ipc_1.postMessageToMain)({
|
|
142
|
+
type: "transfer",
|
|
143
|
+
syncPair: this.sync.syncPair,
|
|
144
|
+
data: {
|
|
145
|
+
of: delta.type,
|
|
146
|
+
type: "error",
|
|
147
|
+
relativePath: delta.path,
|
|
148
|
+
localPath: path_1.default.join(this.sync.syncPair.localPath, delta.path),
|
|
149
|
+
error: (0, utils_1.serializeError)(e)
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
throw e;
|
|
154
|
+
}
|
|
50
155
|
}
|
|
51
156
|
case "deleteRemoteDirectory":
|
|
52
157
|
case "deleteRemoteFile": {
|
|
53
|
-
|
|
54
|
-
|
|
158
|
+
try {
|
|
159
|
+
await this.sync.remoteFileSystem.unlink({ relativePath: delta.path });
|
|
160
|
+
(0, ipc_1.postMessageToMain)({
|
|
161
|
+
type: "transfer",
|
|
162
|
+
syncPair: this.sync.syncPair,
|
|
163
|
+
data: {
|
|
164
|
+
of: delta.type,
|
|
165
|
+
type: "success",
|
|
166
|
+
relativePath: delta.path,
|
|
167
|
+
localPath: path_1.default.join(this.sync.syncPair.localPath, delta.path)
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
return delta;
|
|
171
|
+
}
|
|
172
|
+
catch (e) {
|
|
173
|
+
if (delta.type === "deleteRemoteFile") {
|
|
174
|
+
// Don't throw if the file/directory does not exist anymore.
|
|
175
|
+
if (!(await this.sync.remoteFileSystem.fileExists(delta.path))) {
|
|
176
|
+
return delta;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
if (delta.type === "deleteRemoteDirectory") {
|
|
180
|
+
// Don't throw if the file/directory does not exist anymore.
|
|
181
|
+
if (!(await this.sync.remoteFileSystem.directoryExists(delta.path))) {
|
|
182
|
+
return delta;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
if (e instanceof Error) {
|
|
186
|
+
(0, ipc_1.postMessageToMain)({
|
|
187
|
+
type: "transfer",
|
|
188
|
+
syncPair: this.sync.syncPair,
|
|
189
|
+
data: {
|
|
190
|
+
of: delta.type,
|
|
191
|
+
type: "error",
|
|
192
|
+
relativePath: delta.path,
|
|
193
|
+
localPath: path_1.default.join(this.sync.syncPair.localPath, delta.path),
|
|
194
|
+
error: (0, utils_1.serializeError)(e)
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
throw e;
|
|
199
|
+
}
|
|
55
200
|
}
|
|
56
201
|
case "renameLocalDirectory":
|
|
57
202
|
case "renameLocalFile": {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
203
|
+
try {
|
|
204
|
+
const stats = await this.sync.localFileSystem.rename({
|
|
205
|
+
fromRelativePath: delta.from,
|
|
206
|
+
toRelativePath: delta.to
|
|
207
|
+
});
|
|
208
|
+
(0, ipc_1.postMessageToMain)({
|
|
209
|
+
type: "transfer",
|
|
210
|
+
syncPair: this.sync.syncPair,
|
|
211
|
+
data: {
|
|
212
|
+
of: delta.type,
|
|
213
|
+
type: "success",
|
|
214
|
+
relativePath: delta.path,
|
|
215
|
+
localPath: path_1.default.join(this.sync.syncPair.localPath, delta.path)
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
return Object.assign(Object.assign({}, delta), { stats });
|
|
219
|
+
}
|
|
220
|
+
catch (e) {
|
|
221
|
+
if (e instanceof Error) {
|
|
222
|
+
(0, ipc_1.postMessageToMain)({
|
|
223
|
+
type: "transfer",
|
|
224
|
+
syncPair: this.sync.syncPair,
|
|
225
|
+
data: {
|
|
226
|
+
of: delta.type,
|
|
227
|
+
type: "error",
|
|
228
|
+
relativePath: delta.path,
|
|
229
|
+
localPath: path_1.default.join(this.sync.syncPair.localPath, delta.path),
|
|
230
|
+
error: (0, utils_1.serializeError)(e)
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
throw e;
|
|
235
|
+
}
|
|
63
236
|
}
|
|
64
237
|
case "renameRemoteDirectory":
|
|
65
238
|
case "renameRemoteFile": {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
239
|
+
try {
|
|
240
|
+
await this.sync.remoteFileSystem.rename({
|
|
241
|
+
fromRelativePath: delta.from,
|
|
242
|
+
toRelativePath: delta.to
|
|
243
|
+
});
|
|
244
|
+
(0, ipc_1.postMessageToMain)({
|
|
245
|
+
type: "transfer",
|
|
246
|
+
syncPair: this.sync.syncPair,
|
|
247
|
+
data: {
|
|
248
|
+
of: delta.type,
|
|
249
|
+
type: "success",
|
|
250
|
+
relativePath: delta.path,
|
|
251
|
+
localPath: path_1.default.join(this.sync.syncPair.localPath, delta.path)
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
return delta;
|
|
255
|
+
}
|
|
256
|
+
catch (e) {
|
|
257
|
+
if (e instanceof Error) {
|
|
258
|
+
(0, ipc_1.postMessageToMain)({
|
|
259
|
+
type: "transfer",
|
|
260
|
+
syncPair: this.sync.syncPair,
|
|
261
|
+
data: {
|
|
262
|
+
of: delta.type,
|
|
263
|
+
type: "error",
|
|
264
|
+
relativePath: delta.path,
|
|
265
|
+
localPath: path_1.default.join(this.sync.syncPair.localPath, delta.path),
|
|
266
|
+
error: (0, utils_1.serializeError)(e)
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
throw e;
|
|
271
|
+
}
|
|
71
272
|
}
|
|
72
273
|
case "downloadFile": {
|
|
73
|
-
|
|
74
|
-
|
|
274
|
+
try {
|
|
275
|
+
const stats = await this.sync.remoteFileSystem.download({ relativePath: delta.path });
|
|
276
|
+
const item = this.sync.remoteFileSystem.getDirectoryTreeCache.tree[delta.path];
|
|
277
|
+
if (!item) {
|
|
278
|
+
throw new Error("createLocalDirectory: remoteItem not found in getDirectoryTreeCache.");
|
|
279
|
+
}
|
|
280
|
+
return Object.assign(Object.assign({}, delta), { stats,
|
|
281
|
+
item });
|
|
282
|
+
}
|
|
283
|
+
catch (e) {
|
|
284
|
+
// Don't throw if the file does not exist anymore, simply skip it.
|
|
285
|
+
if (!(await this.sync.remoteFileSystem.fileExists(delta.path))) {
|
|
286
|
+
return null;
|
|
287
|
+
}
|
|
288
|
+
throw e;
|
|
289
|
+
}
|
|
75
290
|
}
|
|
76
291
|
case "uploadFile": {
|
|
77
|
-
|
|
78
|
-
|
|
292
|
+
try {
|
|
293
|
+
const [, stats] = await Promise.all([
|
|
294
|
+
this.sync.localFileSystem.upload({ relativePath: delta.path }),
|
|
295
|
+
fs_extra_1.default.stat(path_1.default.join(this.sync.syncPair.localPath, delta.path))
|
|
296
|
+
]);
|
|
297
|
+
const item = this.sync.remoteFileSystem.getDirectoryTreeCache.tree[delta.path];
|
|
298
|
+
if (!item) {
|
|
299
|
+
throw new Error("createLocalDirectory: remoteItem not found in getDirectoryTreeCache.");
|
|
300
|
+
}
|
|
301
|
+
return Object.assign(Object.assign({}, delta), { item,
|
|
302
|
+
stats });
|
|
303
|
+
}
|
|
304
|
+
catch (e) {
|
|
305
|
+
// Don't throw if the file does not exist anymore, simply skip it.
|
|
306
|
+
if (!(await this.sync.localFileSystem.pathExists(path_1.default.join(this.sync.syncPair.localPath, delta.path)))) {
|
|
307
|
+
return null;
|
|
308
|
+
}
|
|
309
|
+
throw e;
|
|
310
|
+
}
|
|
79
311
|
}
|
|
80
312
|
}
|
|
81
313
|
}
|
|
@@ -94,19 +326,66 @@ class Tasks {
|
|
|
94
326
|
async process({ deltas }) {
|
|
95
327
|
const executed = [];
|
|
96
328
|
const errors = [];
|
|
97
|
-
await (0, utils_1.promiseAllSettledChunked)(
|
|
98
329
|
// Work on deltas from "left to right" (ascending order, path length).
|
|
99
|
-
deltas
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
330
|
+
const deltasSorted = deltas.sort((a, b) => a.path.split("/").length - b.path.split("/").length);
|
|
331
|
+
const renameRemoteDirectoryDeltas = [];
|
|
332
|
+
const renameRemoteFileDeltas = [];
|
|
333
|
+
const renameLocalDirectoryDeltas = [];
|
|
334
|
+
const renameLocalFileDeltas = [];
|
|
335
|
+
const deleteRemoteDirectoryDeltas = [];
|
|
336
|
+
const deleteRemoteFileDeltas = [];
|
|
337
|
+
const deleteLocalDirectoryDeltas = [];
|
|
338
|
+
const deleteLocalFileDeltas = [];
|
|
339
|
+
const createRemoteDirectoryDeltas = [];
|
|
340
|
+
const createLocalDirectoryDeltas = [];
|
|
341
|
+
const uploadFileDeltas = [];
|
|
342
|
+
const downloadFileDeltas = [];
|
|
343
|
+
for (const delta of deltasSorted) {
|
|
344
|
+
if (delta.type === "renameRemoteDirectory") {
|
|
345
|
+
renameRemoteDirectoryDeltas.push(delta);
|
|
346
|
+
}
|
|
347
|
+
else if (delta.type === "renameRemoteFile") {
|
|
348
|
+
renameRemoteFileDeltas.push(delta);
|
|
349
|
+
}
|
|
350
|
+
else if (delta.type === "renameLocalDirectory") {
|
|
351
|
+
renameLocalDirectoryDeltas.push(delta);
|
|
352
|
+
}
|
|
353
|
+
else if (delta.type === "renameLocalFile") {
|
|
354
|
+
renameLocalFileDeltas.push(delta);
|
|
355
|
+
}
|
|
356
|
+
else if (delta.type === "deleteRemoteDirectory") {
|
|
357
|
+
deleteRemoteDirectoryDeltas.push(delta);
|
|
358
|
+
}
|
|
359
|
+
else if (delta.type === "deleteRemoteFile") {
|
|
360
|
+
deleteRemoteFileDeltas.push(delta);
|
|
361
|
+
}
|
|
362
|
+
else if (delta.type === "deleteLocalDirectory") {
|
|
363
|
+
deleteLocalDirectoryDeltas.push(delta);
|
|
364
|
+
}
|
|
365
|
+
else if (delta.type === "deleteLocalFile") {
|
|
366
|
+
deleteLocalFileDeltas.push(delta);
|
|
367
|
+
}
|
|
368
|
+
else if (delta.type === "createRemoteDirectory") {
|
|
369
|
+
createRemoteDirectoryDeltas.push(delta);
|
|
370
|
+
}
|
|
371
|
+
else if (delta.type === "createLocalDirectory") {
|
|
372
|
+
createLocalDirectoryDeltas.push(delta);
|
|
373
|
+
}
|
|
374
|
+
else if (delta.type === "uploadFile") {
|
|
375
|
+
uploadFileDeltas.push(delta);
|
|
376
|
+
}
|
|
377
|
+
else if (delta.type === "downloadFile") {
|
|
378
|
+
downloadFileDeltas.push(delta);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
const process = async (delta) => {
|
|
382
|
+
const semaphore = delta.type === "uploadFile" || delta.type === "downloadFile" ? this.transfersSemaphore : null;
|
|
383
|
+
await (semaphore === null || semaphore === void 0 ? void 0 : semaphore.acquire());
|
|
108
384
|
try {
|
|
109
|
-
const doneTask = await this.processTask(
|
|
385
|
+
const doneTask = await this.processTask(delta);
|
|
386
|
+
if (!doneTask) {
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
110
389
|
executed.push(doneTask);
|
|
111
390
|
}
|
|
112
391
|
catch (e) {
|
|
@@ -120,9 +399,56 @@ class Tasks {
|
|
|
120
399
|
}
|
|
121
400
|
}
|
|
122
401
|
finally {
|
|
123
|
-
|
|
402
|
+
semaphore === null || semaphore === void 0 ? void 0 : semaphore.release();
|
|
124
403
|
}
|
|
125
|
-
}
|
|
404
|
+
};
|
|
405
|
+
// Rename/move/delete/createDir tasks need to run synchronously, e.g. one after another, due to applying executed tasks to the delta state.
|
|
406
|
+
// Upload/download tasks can run in parallel.
|
|
407
|
+
// The order of running tasks is also set:
|
|
408
|
+
// 1. Local directory renaming/moving
|
|
409
|
+
// 2. Local file renaming/moving
|
|
410
|
+
// 3. Remote directory renaming/moving
|
|
411
|
+
// 4. Remote file renaming/moving
|
|
412
|
+
// 5. Local directory deletions
|
|
413
|
+
// 6. Local file deletions
|
|
414
|
+
// 7. Remote directory deletions
|
|
415
|
+
// 8. Remote file deletions
|
|
416
|
+
// 9. Local directory creations
|
|
417
|
+
// 10. Remote directory creations
|
|
418
|
+
// 11. File uploads
|
|
419
|
+
// 12. File downloads
|
|
420
|
+
for (const delta of renameLocalDirectoryDeltas) {
|
|
421
|
+
await process(delta);
|
|
422
|
+
}
|
|
423
|
+
for (const delta of renameLocalFileDeltas) {
|
|
424
|
+
await process(delta);
|
|
425
|
+
}
|
|
426
|
+
for (const delta of renameRemoteDirectoryDeltas) {
|
|
427
|
+
await process(delta);
|
|
428
|
+
}
|
|
429
|
+
for (const delta of renameRemoteFileDeltas) {
|
|
430
|
+
await process(delta);
|
|
431
|
+
}
|
|
432
|
+
for (const delta of deleteLocalDirectoryDeltas) {
|
|
433
|
+
await process(delta);
|
|
434
|
+
}
|
|
435
|
+
for (const delta of deleteLocalFileDeltas) {
|
|
436
|
+
await process(delta);
|
|
437
|
+
}
|
|
438
|
+
for (const delta of deleteRemoteDirectoryDeltas) {
|
|
439
|
+
await process(delta);
|
|
440
|
+
}
|
|
441
|
+
for (const delta of deleteRemoteFileDeltas) {
|
|
442
|
+
await process(delta);
|
|
443
|
+
}
|
|
444
|
+
for (const delta of createLocalDirectoryDeltas) {
|
|
445
|
+
await process(delta);
|
|
446
|
+
}
|
|
447
|
+
for (const delta of createRemoteDirectoryDeltas) {
|
|
448
|
+
await process(delta);
|
|
449
|
+
}
|
|
450
|
+
await (0, utils_1.promiseAllChunked)(uploadFileDeltas.map(process));
|
|
451
|
+
await (0, utils_1.promiseAllChunked)(downloadFileDeltas.map(process));
|
|
126
452
|
return {
|
|
127
453
|
doneTasks: executed,
|
|
128
454
|
errors
|
package/dist/lib/tasks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../src/lib/tasks.ts"],"names":[],"mappings":";;;AAEA,oCAAmD;AAGnD,4CAAwC;AAsExC;;;;;;;GAOG;AACH,MAAa,KAAK;IAIjB;;;;;;OAMG;IACH,YAAmB,IAAU;QATZ,UAAK,GAAG,IAAI,qBAAS,CAAC,CAAC,CAAC,CAAA;QAUxC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IACjB,CAAC;IAED;;;;;;;;;OASG;IACK,KAAK,CAAC,WAAW,CAAC,EAAE,KAAK,EAAoB;QACpD,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;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