locize-cli 7.12.1 → 7.12.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/CHANGELOG.md +4 -0
- package/download.js +4 -2
- package/package.json +1 -1
- package/sync.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
Project versioning adheres to [Semantic Versioning](http://semver.org/).
|
|
6
6
|
Change log format is based on [Keep a Changelog](http://keepachangelog.com/).
|
|
7
7
|
|
|
8
|
+
## [7.12.2](https://github.com/locize/locize-cli/compare/v7.12.1...v7.12.2) - 2022-07-12
|
|
9
|
+
|
|
10
|
+
- limit parallel downloads
|
|
11
|
+
|
|
8
12
|
## [7.12.1](https://github.com/locize/locize-cli/compare/v7.12.0...v7.12.1) - 2022-07-12
|
|
9
13
|
|
|
10
14
|
- limit parallel downloads
|
package/download.js
CHANGED
|
@@ -34,7 +34,7 @@ function handleDownload(opt, url, err, res, downloads, cb) {
|
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
async.eachLimit(downloads,
|
|
37
|
+
async.eachLimit(downloads, 20, (download, clb) => {
|
|
38
38
|
const splitted = download.key.split('/');
|
|
39
39
|
const version = splitted[download.isPrivate ? 2 : 1];
|
|
40
40
|
const lng = splitted[download.isPrivate ? 3 : 2];
|
|
@@ -95,7 +95,7 @@ function handleDownload(opt, url, err, res, downloads, cb) {
|
|
|
95
95
|
|
|
96
96
|
function handlePull(opt, toDownload, cb) {
|
|
97
97
|
const url = opt.apiPath + '/pull/' + opt.projectId + '/' + opt.version;
|
|
98
|
-
async.eachLimit(toDownload,
|
|
98
|
+
async.eachLimit(toDownload, 20, (download, clb) => {
|
|
99
99
|
const lng = download.language;
|
|
100
100
|
const namespace = download.namespace;
|
|
101
101
|
|
|
@@ -203,11 +203,13 @@ const download = (opt, cb) => {
|
|
|
203
203
|
'Authorization': opt.apiKey
|
|
204
204
|
} : undefined
|
|
205
205
|
}, (err, res, obj) => {
|
|
206
|
+
obj = obj || [];
|
|
206
207
|
if (res && res.status === 401) {
|
|
207
208
|
opt.apiKey = null;
|
|
208
209
|
request(url, {
|
|
209
210
|
method: 'get',
|
|
210
211
|
}, (err, res, obj) => {
|
|
212
|
+
obj = obj || [];
|
|
211
213
|
if (opt.skipEmpty) obj = obj.filter((d) => d.size > 2);
|
|
212
214
|
handleDownload(opt, url, err, res, obj, cb);
|
|
213
215
|
});
|
package/package.json
CHANGED
package/sync.js
CHANGED
|
@@ -205,7 +205,7 @@ const downloadAll = (opt, remoteLanguages, omitRef, manipulate, cb) => {
|
|
|
205
205
|
return lng !== opt.referenceLanguage;
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
-
async.eachLimit(downloads,
|
|
208
|
+
async.eachLimit(downloads, 20, (download, clb) => {
|
|
209
209
|
const splitted = download.key.split('/');
|
|
210
210
|
const lng = splitted[download.isPrivate ? 3 : 2];
|
|
211
211
|
const namespace = splitted[download.isPrivate ? 4 : 3];
|
|
@@ -509,7 +509,7 @@ const handleSync = (opt, remoteLanguages, localNamespaces, cb) => {
|
|
|
509
509
|
|
|
510
510
|
if (opt.deleteRemoteNamespace && localMissingNamespaces.length > 0) {
|
|
511
511
|
wasThereSomethingToUpdate = true;
|
|
512
|
-
async.eachLimit(localMissingNamespaces,
|
|
512
|
+
async.eachLimit(localMissingNamespaces, 20, (n, clb) => {
|
|
513
513
|
if (opt.dry) {
|
|
514
514
|
console.log(colors.red(`would delete complete namespace ${n.namespace}...`));
|
|
515
515
|
return clb();
|