https://discord.cloudflare.com logo
Join Discord
Powered by
# workers-discussions
  • u

    Unsmart | Tech debt

    03/05/2023, 5:54 AM
    It depends how long the average request take I think like 300ish Ms is the cutoff where bundled becomes cheaper though
  • d

    dave

    03/05/2023, 6:13 AM
    fastest seems to be 500ms to 600ms.
  • d

    dave

    03/05/2023, 6:23 AM
    I'm doing a fanout to multiple S3 endpoints in different regions, so high latency is kinda expected by design.
  • a

    Advany

    03/05/2023, 8:38 AM
    @dave where you able to figure out if there is a rate limit for IP's on workers/pages on a paid plan using a custom domain?. And is it possible to disable it?
  • s

    Skye

    03/05/2023, 9:22 AM
    It's ~225ms
  • d

    dave

    03/05/2023, 3:01 PM
    Hero, thank you.
  • d

    dave

    03/05/2023, 3:02 PM
    Na
  • d

    dave

    03/05/2023, 3:37 PM
    sanity check, if
    .put()
    resolves, does that always mean it succeeded?
  • h

    HardAtWork

    03/05/2023, 3:38 PM
    I'd assume you should at least check for the returned
    R2Object
    if you want to be 100% sure?
  • d

    dave

    03/05/2023, 3:39 PM
    Copy code
    typescript
        if(c.env.R2_LOGGING) {
            s3_promise_results.push(new Promise((resolve, reject) => {
                return c.env.R2_LOGGING.put(filename, incoming_arraybuffer, {
                    httpMetadata: {
                        contentType: 'application/json',
                        contentLanguage: 'en'
                    }
                }).then((r2_result) => {
                    console.log(`Uploaded ${r2_result.key} to R2 bucket successfully`);
                    resolve(new Response());
                }).catch((r2_error) => {
                    console.error(`Failed to upload to R2 bucket`);
                    reject(r2_error);
                });
            }));
        }
  • d

    dave

    03/05/2023, 3:39 PM
    does that look correct?
  • s

    Skye

    03/05/2023, 3:40 PM
    resolve(new Response())
    looks a bit weird in my eyes
  • s

    Skye

    03/05/2023, 3:40 PM
    but nothing looks wrong with the code
  • d

    dave

    03/05/2023, 3:42 PM
    s3_promise_results is an array of Responses from aws4fetch, wanted to keep the array uniform
  • d

    dave

    03/05/2023, 5:50 PM
    dear lord, 4 seconds sometimes
  • s

    Skye

    03/05/2023, 5:58 PM
    You might be able to do something with Promise.all()?
  • d

    dave

    03/05/2023, 5:59 PM
    Yeah I do promise allSettled already 🙂
  • s

    Skye

    03/05/2023, 5:59 PM
    Ah, just slow work then
  • d

    dave

    03/05/2023, 6:00 PM
    The latency is fine tbh, just good to know I picked the right billing type.
  • h

    heftymouse

    03/05/2023, 6:16 PM
    are socket workers publicly available yet?
  • z

    zegevlier

    03/05/2023, 6:16 PM
    Not yet
  • z

    zegevlier

    03/05/2023, 6:17 PM
    They are in workerd, so if you really want you can build something on them already, but the API might still change.
  • h

    heftymouse

    03/05/2023, 6:17 PM
    rip
  • e

    Erisa | Support Engineer

    03/05/2023, 6:18 PM
    they're under active development
  • h

    heftymouse

    03/05/2023, 6:18 PM
    are they still accepting requests to join the preview?
  • h

    heftymouse

    03/05/2023, 6:18 PM
    i see
  • e

    Erisa | Support Engineer

    03/05/2023, 6:19 PM
    you can join the waitlist here https://www.cloudflare.com/database-connectors-early-access/
  • h

    heftymouse

    03/05/2023, 6:19 PM
    i'll give it a shot, thanks
  • d

    dave

    03/05/2023, 7:13 PM
    so if I want to generate a presigned R2/S3 URL, and automatically delete the uploaded file after like an hour, should I be using Durable Objects?
  • j

    James

    03/05/2023, 7:14 PM
    DO Alarms sound great for that. Or writing to KV and checking on a cron maybe
1...231923202321...2509Latest