incyclist-services 1.3.42 → 1.3.44
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.
|
@@ -73,7 +73,7 @@ class RoutesApiLoader extends types_1.Loader {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
if (loadDetailRequired.length > 0)
|
|
76
|
-
yield this.loadDetails(loadDetailRequired);
|
|
76
|
+
yield this.loadDetails(loadDetailRequired, true);
|
|
77
77
|
this.loadObserver.emit('done');
|
|
78
78
|
yield (0, utils_1.waitNextTick)();
|
|
79
79
|
this.loadObserver.stop();
|
|
@@ -105,6 +105,7 @@ class RoutesApiLoader extends types_1.Loader {
|
|
|
105
105
|
}
|
|
106
106
|
else {
|
|
107
107
|
description.tsImported = existing.tsImported;
|
|
108
|
+
items.push({ route: new route_1.Route(description), added: false });
|
|
108
109
|
this.logger.logEvent({ message: 'route updated', id: description.id, title: description.title, from: existing.version, to: description.version, ts: Date.now(), tsImported: description.tsImported });
|
|
109
110
|
}
|
|
110
111
|
}
|
|
@@ -171,6 +172,15 @@ class RoutesApiLoader extends types_1.Loader {
|
|
|
171
172
|
}
|
|
172
173
|
loadDetails(items_1) {
|
|
173
174
|
return __awaiter(this, arguments, void 0, function* (items, enforced = false) {
|
|
175
|
+
try {
|
|
176
|
+
const isUnique = (v, i, a) => {
|
|
177
|
+
return a.findIndex(item => item.route.description.id === v.route.description.id) === i;
|
|
178
|
+
};
|
|
179
|
+
items = items.filter(isUnique);
|
|
180
|
+
}
|
|
181
|
+
catch (err) {
|
|
182
|
+
this.logger.logEvent({ message: 'error', fn: 'loadDetails#unique', error: err.message, stack: err.stack });
|
|
183
|
+
}
|
|
174
184
|
const failed = enforced ? items : yield this.loadDetailsFromRepo(items);
|
|
175
185
|
const promises = failed.map(i => this.getDetails(i.route));
|
|
176
186
|
const res = yield Promise.allSettled(promises);
|