[feature-274] 5 to 20 concurent downlaod + write metadata on after downloading bs via oculus

This commit is contained in:
MathieuG-P
2023-11-02 21:33:37 +01:00
parent 685313a133
commit f45698121f
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -169,7 +169,7 @@ export class OculusDownloader {
return EMPTY;
})
);
}, 5),
}, 20),
scan((acc, curr) => acc + curr.diff, 0),
);
@@ -145,6 +145,8 @@ export class BsOculusDownloaderService {
public downloadVersion(downloadInfo: DownloadInfo): Observable<Progression<BSVersion>>{
let downloadVersion: BSVersion
return from(this.getUserTokenFromMetaAuth(downloadInfo.stay)).pipe(
switchMap(token => {
if(!downloadInfo.isVerification){
@@ -153,10 +155,12 @@ export class BsOculusDownloaderService {
return this.versions.getVersionPath(downloadInfo.bsVersion).then(path => ({token, version: downloadInfo.bsVersion, dest: path}));
}),
switchMap(({token, version, dest}) => {
downloadVersion = version;
return this.oculusDownloader.downloadApp({ accessToken: token, binaryId: version.OculusBinaryId, destination: dest }).pipe(map(
progress => ({...progress, data: version})
));
}),
finalize(() => downloadVersion && this.versions.setVersionMetadata(downloadInfo.bsVersion, "store", BsStore.OCULUS)),
finalize(() => this.oculusDownloader.stopDownload())
);
}