@geode/opengeodeweb-front 10.21.1-rc.1 → 10.21.1-rc.2
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/app/utils/import_workflow.js +36 -4
- package/package.json +1 -1
|
@@ -11,9 +11,25 @@ import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
|
|
|
11
11
|
import { useTreeviewStore } from "@ogw_front/stores/treeview";
|
|
12
12
|
|
|
13
13
|
async function importWorkflow(files) {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
)
|
|
14
|
+
const chunk_size = 5;
|
|
15
|
+
const chunks = [];
|
|
16
|
+
for (let i = 0; i < files.length; i += chunk_size) {
|
|
17
|
+
chunks.push(files.slice(i, i + chunk_size));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const results = [];
|
|
21
|
+
async function processChunk(chunkIndex) {
|
|
22
|
+
if (chunkIndex >= chunks.length) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const chunk = chunks[chunkIndex];
|
|
26
|
+
const chunk_results = await Promise.all(
|
|
27
|
+
chunk.map(({ filename, geode_object_type }) => importFile(filename, geode_object_type)),
|
|
28
|
+
);
|
|
29
|
+
results.push(...chunk_results);
|
|
30
|
+
await processChunk(chunkIndex + 1);
|
|
31
|
+
}
|
|
32
|
+
await processChunk(0);
|
|
17
33
|
const hybridViewerStore = useHybridViewerStore();
|
|
18
34
|
hybridViewerStore.remoteRender();
|
|
19
35
|
return results;
|
|
@@ -80,7 +96,23 @@ async function importWorkflowFromSnapshot(items) {
|
|
|
80
96
|
console.log("[importWorkflowFromSnapshot] start", { count: items?.length });
|
|
81
97
|
const hybridViewerStore = useHybridViewerStore();
|
|
82
98
|
|
|
83
|
-
const
|
|
99
|
+
const chunk_size = 5;
|
|
100
|
+
const chunks = [];
|
|
101
|
+
for (let i = 0; i < items.length; i += chunk_size) {
|
|
102
|
+
chunks.push(items.slice(i, i + chunk_size));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const ids = [];
|
|
106
|
+
async function processChunk(chunkIndex) {
|
|
107
|
+
if (chunkIndex >= chunks.length) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const chunk = chunks[chunkIndex];
|
|
111
|
+
const chunk_ids = await Promise.all(chunk.map((item) => importItem(item)));
|
|
112
|
+
ids.push(...chunk_ids);
|
|
113
|
+
await processChunk(chunkIndex + 1);
|
|
114
|
+
}
|
|
115
|
+
await processChunk(0);
|
|
84
116
|
hybridViewerStore.remoteRender();
|
|
85
117
|
console.log("[importWorkflowFromSnapshot] done", { ids });
|
|
86
118
|
return ids;
|
package/package.json
CHANGED