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

    PatrickJ

    04/01/2023, 10:36 AM
    Is there Workers equivalent to Serverless Console? (https://www.serverless.com/console)
  • h

    HardAtWork

    04/01/2023, 10:45 AM
    Sounds like `wrangler tail`/LogPush
  • p

    PatrickJ

    04/01/2023, 10:49 AM
    Looking for ui for production though. Not interested in fancy dashboards, looking for simple way to find a request by metadata and explore what happen inside it's invocation
  • h

    HardAtWork

    04/01/2023, 11:17 AM
    Datadog?
  • h

    HardAtWork

    04/01/2023, 11:17 AM
    You can use it as a LogPush target
  • p

    PatrickJ

    04/01/2023, 11:32 AM
    Yeah I'm about to check it out
  • r

    razbakov

    04/01/2023, 2:41 PM
    I am having a problem with deploying prisma https://github.com/prisma/prisma/issues/18593 Does anyone have experience?
  • GitHub - evanderkoogh/otel-cf-workers: A...
    e

    Erwin

    04/01/2023, 2:53 PM
    Just going to leave this here: https://github.com/evanderkoogh/otel-cf-workers
    w
    s
    y
    • 4
    • 11
  • e

    Erwin

    04/01/2023, 2:53 PM
    still extremely early days, but pretty happy with it as a first step
  • k

    Klowner

    04/01/2023, 5:26 PM
    The docs state that subrequests to internal services like workers KV and durable objects are limited to 1000 per request, I assume that includes R2 as well?
  • z

    zegevlier

    04/01/2023, 5:26 PM
    I believe so, yes.
  • z

    zegevlier

    04/01/2023, 5:27 PM
    If you're using the binding, not if you're using the S3 API
  • k

    Klowner

    04/01/2023, 5:27 PM
    yep, excellent, thank you!
  • s

    sirhype

    04/01/2023, 7:26 PM
    I've got a domain, worker, and CF pages that are part of my personal account. However I'd like to move it to an account for the product, rather than my personal account. Anyone have any advice/documentation on moving this with little to no downtime? Worker mostly, but also Pages + DNS too ideally
  • p

    Platyperry

    04/01/2023, 7:36 PM
    I've got a worker that returns a data stream to the user. any idea how I could also save that data to a KV name at the end?
  • p

    Platyperry

    04/01/2023, 7:37 PM
    Copy code
    ts
        const [s1, s2] = stream.tee();
    
        s2.getReader().read().then(reader => {
            env.FORM_HISTORY.put("READ_DATA", JSON.parse(String(reader.value ) ?? ""))
        })
    
        return new Response(s1)
    I've got the stream split into two (Stream#tee), then I return the first stream, and in theory save the second stream at the end
  • p

    Platyperry

    04/01/2023, 7:37 PM
    but it's not saving the data
  • s

    Skye

    04/01/2023, 7:54 PM
    The workers runtime is seeing that you've returned a response, and is ending the processing of the request before that additional promise completes. What you'll want to do is wrap that
    s2.getReader()....then()
    in
    ctx.waitUntil
    , which will wait for the promise to complete
  • s

    Skye

    04/01/2023, 7:54 PM
    (ctx is the third argument in your exported
    fetch
    function)
  • p

    Platyperry

    04/01/2023, 7:55 PM
    But wouldn't a ctx.waitUntil mean that nothing is sent to the user until the end?
  • p

    Platyperry

    04/01/2023, 7:55 PM
    since I need to stream the data to the user as I get it
  • s

    Skye

    04/01/2023, 7:55 PM
    The waitUntil runs after the response is returned
  • p

    Platyperry

    04/01/2023, 7:55 PM
    ah awesome!
  • p

    Platyperry

    04/01/2023, 7:55 PM
    thank you very much!
  • h

    HardAtWork

    04/01/2023, 7:57 PM
    Well, it doesn’t guarantee that it runs after, just that the runtime doesn’t immediately abort after returning a response
  • p

    Platyperry

    04/01/2023, 7:59 PM
    Does that mean that it might still get killed before saving?
  • h

    HardAtWork

    04/01/2023, 8:01 PM
    Generally, it will stay alive for up to 30 seconds, but there’s a small chance it’s aborted after that
  • p

    Platyperry

    04/01/2023, 8:02 PM
    Oh interesting, I always assumed if it was just streaming data it would keep working
  • p

    Platyperry

    04/01/2023, 8:02 PM
    thank you!
  • s

    sathoro

    04/02/2023, 9:31 AM
    how to detect when the request is canceled on the client side in a worker?
1...237423752376...2509Latest