sliftutils 1.7.56 → 1.7.57
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.d.ts +1 -1
- package/package.json +1 -1
- package/storage/IArchives.ts +2 -1
- package/storage/backblaze.ts +11 -7
- package/storage/dist/IArchives.ts.cache +3 -2
- package/storage/dist/backblaze.ts.cache +15 -8
- package/storage/remoteStorage/blobStore.ts +5 -8
- package/storage/remoteStorage/createArchives.d.ts +1 -1
- package/storage/remoteStorage/createArchives.ts +6 -4
- package/storage/remoteStorage/dist/blobStore.ts.cache +7 -12
- package/storage/remoteStorage/dist/createArchives.ts.cache +9 -7
- package/storage/remoteStorage/dist/sourceWrapper.ts.cache +2 -2
- package/storage/remoteStorage/dist/storageServerState.ts.cache +2 -2
|
@@ -802,20 +802,22 @@ export class ArchivesChain implements IArchives {
|
|
|
802
802
|
return urls[0];
|
|
803
803
|
}
|
|
804
804
|
|
|
805
|
-
/** Every URL that could serve this path
|
|
805
|
+
/** Every URL that could serve this path: public sources matching both the path's route and the current valid window. The first is the write node's (first matching source in config order, see runWrite - the one guaranteed current); the rest are ranked fastest-first by measured latency. Empty when none qualify. */
|
|
806
806
|
public async getURLs(path: string): Promise<string[]> {
|
|
807
807
|
let state = await this.getState();
|
|
808
808
|
let route = getRoute(path);
|
|
809
|
-
let
|
|
809
|
+
let candidates: { source: SourceWrapper; provider: IArchives }[] = [];
|
|
810
810
|
for (let source of state.sources) {
|
|
811
811
|
if (!(source.config.public ?? true)) continue;
|
|
812
812
|
if (!routeContains(source.config.route, route)) continue;
|
|
813
813
|
if (!configWindowCurrent(source.config)) continue;
|
|
814
814
|
let provider = source.url || source.api;
|
|
815
815
|
if (!provider) continue;
|
|
816
|
-
|
|
816
|
+
candidates.push({ source, provider });
|
|
817
817
|
}
|
|
818
|
-
let
|
|
818
|
+
let rest = candidates.slice(1);
|
|
819
|
+
sort(rest, x => x.source.getLatency());
|
|
820
|
+
let urls = await Promise.all([...candidates.slice(0, 1), ...rest].map(x => x.provider.getURL(path)));
|
|
819
821
|
return [...new Set(urls)];
|
|
820
822
|
}
|
|
821
823
|
|