fix: use Qiniu form uploads for prepared download files
This commit is contained in:
parent
ed25603be2
commit
f8c97ba7e4
@ -38,7 +38,7 @@ export async function prepareImageArchiveDownload(id: string) {
|
||||
phase = "store";
|
||||
const url = source.buffer.equals(asset.bytes) && asset.contentType === "image/png"
|
||||
? task.targetUrl
|
||||
: (await uploadFile(`canvas-download-${randomUUID()}.${asset.filename.split(".").pop() || "png"}`, Uint8Array.from(asset.bytes).buffer)).url;
|
||||
: (await uploadFile(`canvas-download-${randomUUID()}.${asset.filename.split(".").pop() || "png"}`, Uint8Array.from(asset.bytes).buffer, { preferQiniuForm: true })).url;
|
||||
await saveImageDownloadAsset(id, { status: "ready", url, bytes: asset.bytes.length,
|
||||
contentType: asset.contentType, preparedAt: new Date().toISOString() });
|
||||
await cacheImageBytes(`source::${url}`, { buffer: asset.bytes, contentType: asset.contentType });
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user