sliftutils 1.7.93 → 1.7.94

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sliftutils",
3
- "version": "1.7.93",
3
+ "version": "1.7.94",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -228,12 +228,13 @@ export class ArchivesChain implements IArchives {
228
228
  }
229
229
  console.log(`Storage routing config for ${this.getDebugName()} is out of date (stored version ${existing && getConfigVersion(existing) || "none"}, ours ${getConfigVersion(this.configured)}): writing ours to all ${writtenUrls.size} nodes (write time ${new Date(routingWriteTime).toISOString()}): ${[...writtenUrls].join(", ")}`);
230
230
  writtenUrls.clear();
231
- for (let source of sources) {
232
- if (writtenUrls.has(source.config.url)) continue;
231
+ // We have to write to all the sources, of course. Otherwise, we get into weird situations where a broken source prevents us from writing to a source that would accept the write, and the source is broken because we didn't write to the other source.
232
+ await Promise.allSettled(sources.map(async source => {
233
+ if (writtenUrls.has(source.config.url)) return;
233
234
  writtenUrls.add(source.config.url);
234
235
  await source.write(archives => archives.set(ROUTING_FILE, routingData, { lastModified: routingWriteTime }));
235
236
  console.log(`Wrote storage routing config version ${getConfigVersion(this.configured)} to ${source.config.url}`);
236
- }
237
+ }));
237
238
  } catch (e) {
238
239
  for (let source of sources) {
239
240
  source.dispose();