mobiletto 1.1.32 → 1.1.33
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/index.js +10 -9
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -523,21 +523,22 @@ async function mobiletto (driverPath, key, secret, opts, encryption = null) {
|
|
|
523
523
|
return META_LOAD_QUEUE
|
|
524
524
|
}
|
|
525
525
|
|
|
526
|
-
const waitForFiles = (files, entries, resolve) => {
|
|
527
|
-
if (files.length === entries.length) {
|
|
528
|
-
resolve(files)
|
|
529
|
-
} else {
|
|
530
|
-
setTimeout(() => { waitForFiles(files, entries, resolve) }, 1000)
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
|
|
534
526
|
const _loadMeta = async (dirent, entries) => {
|
|
535
527
|
const files = []
|
|
528
|
+
|
|
529
|
+
const waitForFiles = (resolve) => {
|
|
530
|
+
if (files.length === entries.length) {
|
|
531
|
+
resolve(files)
|
|
532
|
+
} else {
|
|
533
|
+
setTimeout(() => waitForFiles(resolve), 1000)
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
|
|
536
537
|
for (const entry of entries) {
|
|
537
538
|
const job = { dirent, entry, files }
|
|
538
539
|
metaLoadQueue().add(META_LOAD_JOB_NAME, job)
|
|
539
540
|
}
|
|
540
|
-
await new Promise(resolve => waitForFiles(
|
|
541
|
+
await new Promise(resolve => waitForFiles(resolve))
|
|
541
542
|
return files
|
|
542
543
|
}
|
|
543
544
|
|