
Cf-Cache-Status: MISS and all the subsequent ones were HIT, so it means that only 1 operation has been made? What about let's say 3GB videos and caching?
write statement and then using then for the r2 upload... was seeming to work if I never await that promise, but I'd like the upload to occur before sending my response downstream... unsure why it determines that the promise will enver resolveCf-Cache-Status: MISSHITUncaught (in promise) TypeError: Provided readable stream must have a known length (request/response body or readable half of FixedLengthStream)writethenif (md.val) {
console.log("MD", md.val)
await env.CONTENT_BUCKET.put(`${key}-md`, new ReadableStream(md.val))
}while (true) {
let foo = await reader.read();
if (foo.value) {
console.log(foo.value)
let md = metadataExtractor.extract(foo.value)
if (md.val) {
let encoder = new TextEncoder()
let strung = encoder.encode(JSON.stringify(md.val))
console.log("MD", strung)
console.log(strung.length)
let {readable, writable} = new FixedLengthStream(strung.length)
let writer = writable.getWriter()
await writer.write(strung).then(e => console.log({e}))
await env.CONTENT_BUCKET.put(`${key}-md`, readable)
console.log("PUT METADATA IN R2")
}
}A hanging Promise was canceled. This happens when the worker runtime is waiting for a Promise from JavaScript to resolve, but has detected that the Promise cannot possibly ever resolve because all code and events related to the Promise's I/O context have already finished.
A hanging Promise was canceled. This happens when the worker runtime is waiting for a Promise from JavaScript to resolve, but has detected that the Promise cannot possibly ever resolve because all code and events related to the Promise's I/O context have already finished.writer.write(strung).then(() => {
env.CONTENT_BUCKET.put(`${key}-md`, readable)
}))if (foo.done) {
break
}
}
metadataExtractor.clear()
await bucketUpload;
await env.CONTENT_BUCKET.put(`${key}-md`, readable)
return new Response(`Put ${key} successfully! with count of ${count}`);