Commit 17d38b0d authored by nanahira's avatar nanahira

put back to download each req

parent 4f3d0016
Pipeline #17472 canceled with stages
in 28 seconds
...@@ -167,7 +167,7 @@ export class OneTwoThreeService extends MiddlewareService { ...@@ -167,7 +167,7 @@ export class OneTwoThreeService extends MiddlewareService {
if (!uploadReq.data.data.AccessKeyId) { if (!uploadReq.data.data.AccessKeyId) {
// already uploaded // already uploaded
// return JSON.stringify(adaptFileInfo(uploadReq.data.data.Info)); // return JSON.stringify(adaptFileInfo(uploadReq.data.data.Info));
const existing = await this.getDownloadUrl( const existing = JSON.stringify(
adaptFileInfo(uploadReq.data.data.Info), adaptFileInfo(uploadReq.data.data.Info),
); );
this.log(`File ${fileName} exists as ${existing}, skipping.`); this.log(`File ${fileName} exists as ${existing}, skipping.`);
...@@ -208,7 +208,7 @@ export class OneTwoThreeService extends MiddlewareService { ...@@ -208,7 +208,7 @@ export class OneTwoThreeService extends MiddlewareService {
}, },
), ),
); );
const uploadedUrl = await this.getDownloadUrl( const uploadedUrl = JSON.stringify(
adaptFileInfo(completeReq.data.data.Info), adaptFileInfo(completeReq.data.data.Info),
); );
this.log(`Uploaded ${fileName} as ${uploadedUrl}`); this.log(`Uploaded ${fileName} as ${uploadedUrl}`);
...@@ -253,7 +253,8 @@ export class OneTwoThreeService extends MiddlewareService { ...@@ -253,7 +253,8 @@ export class OneTwoThreeService extends MiddlewareService {
async download(info) { async download(info) {
try { try {
return await this.parse302(info.url); const fileInfo = JSON.parse(info.url) as FileInfo;
return await this.parse302(await this.getDownloadUrl(fileInfo));
} catch (e) { } catch (e) {
this.error(`Download failed: ${e.message}`); this.error(`Download failed: ${e.message}`);
throw new BlankReturnMessageDto(500, e.message).toException(); throw new BlankReturnMessageDto(500, e.message).toException();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment