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

    silence

    05/27/2023, 2:46 PM
    i'm curious is the limit of d1 queries 1000 for unbounded?
  • s

    silence

    05/27/2023, 2:47 PM
    also does it not support ON CONFLICT DO NOTHING
  • s

    silence

    05/27/2023, 2:48 PM
    I guess maybe i can use INSERT OR IGNORE
  • i

    Isaac McFadyen | YYZ01

    05/27/2023, 2:53 PM
    https://www.sqlite.org/lang_conflict.html > The ON CONFLICT clause is a non-standard extension specific to SQLite that can appear in many other SQL commands. It is given its own section in this document because it is not part of standard SQL and therefore might not be familiar. Guessing that's cause it's non-standard, yeah.
  • z

    zizi

    05/27/2023, 2:54 PM
    Thanks all! let's ignore for `Object.values `syntax for now.. I'm curious for why worker
    WritableStream
    (controller.error) not beahvior same as Chrome....
  • d

    dave

    05/27/2023, 3:26 PM
    sanity check, if I do
    cache.put
    in a Worker with a URL like
    http://private.invalid/hello
    , can I purge it in every Worker datacenter using
    https://api.cloudflare.com/client/v4/zones/{identifier}/purge_cache
    with the URL set to
    http://private.invalid/hello
    even though that isn't a "real" zone? https://developers.cloudflare.com/workers/runtime-apis/cache/#put https://developers.cloudflare.com/api/operations/zone-purge#purge-cached-content-by-url
  • c

    Cyb3r-Jok3

    05/27/2023, 3:29 PM
    Yeah as long as it isn't an active zone on Cloudflare https://developers.cloudflare.com/workers/learning/how-the-cache-works/#single-file-purge--assets-cached-by-a-worker
  • s

    sirupsen

    05/27/2023, 3:39 PM
    I'm struggling to find any documentation on keep alive connections for workers If I do
    fetch(url_a)
    , will requests in the same request re-use the same connection to
    url.host
    ? Like e.g. Chrome What about between different requests that connect to
    url.host
    ?
  • k

    kian

    05/27/2023, 3:44 PM
    You probably wouldn't want to look for information specifically relating to Workers - Workers or not, requests to origins go through the normal Cloudflare flow.
  • k

    kian

    05/27/2023, 3:44 PM
    https://community.cloudflare.com/t/2019-9-19-workers-runtime-release-notes-concurrent-subrequest-limit/115546/27?u=kiannh
  • d

    dave

    05/27/2023, 3:46 PM
    example.invalid will never be an active zone though, so I should always be safe I think?
  • k

    kian

    05/27/2023, 3:46 PM
    It's a fairly old post, so https://blog.cloudflare.com/how-we-built-pingora-the-proxy-that-connects-cloudflare-to-the-internet/ might be more accurate on implementation details (as this replaced the NGINX instance that did origin requests)
  • s

    sirupsen

    05/27/2023, 3:46 PM
    Ahhh, didn't expect it to be handled outside the runtime like that. Very nice, makes sense 🙂
  • s

    sirupsen

    05/27/2023, 3:47 PM
    Will read that post in a bit more detail, but from the diagram it looks like what I'd expect. Great, thanks for your all your answers kian!
  • c

    Cyb3r-Jok3

    05/27/2023, 3:47 PM
    Yeah you would be
  • k

    kian

    05/27/2023, 3:48 PM
    I don't recall if this diagram is truly accurate, but you can think of it like this.

    https://cdn.discordapp.com/attachments/779390076219686943/1112044732219150446/image2-31.pngâ–¾

  • k

    kian

    05/27/2023, 3:49 PM
    When a Worker makes a subrequest, it'll go through everything again (FL -> Cache -> Pingora -> Origin) - so other than you get a fancy
    CF-Worker
    request header added so origins can identify your Worker opposed to other Workers, it's basically identical.
  • d

    dave

    05/27/2023, 5:08 PM
    From a Worker, is there an easy way to get the closest R2 region without resorting to using a load balancer?
  • h

    HardAtWork

    05/27/2023, 5:17 PM
    Maybe try creating a bucket and then reading the region?
  • d

    dave

    05/27/2023, 5:20 PM
    that will break as soon as there's accidentally 1000 concurrent requests though 😛
  • h

    HardAtWork

    05/27/2023, 5:20 PM
    Then cache the mapping in KV?
  • s

    silence

    05/27/2023, 5:23 PM
    oh so only concurrent? if you wait for them to finish you'll be good?
  • s

    silence

    05/27/2023, 5:29 PM
    const stmt = await DB.prepare("SELECT * FROM balances WHERE thing = ?1 "); const existingRecords = await stmt.bind(thing, ).all(); will this result in multiple queries each time existingRecords is used? I keep having my application time out and i think it's from too many requess
  • s

    silence

    05/27/2023, 5:33 PM
    i notice theres a .run method
  • s

    silence

    05/27/2023, 5:42 PM
    maybe there's an easy way i can just migrate the "seed" data that i need to the db from my local host, Basically the app scapes a whole bunch of data on initial deployment, but after it's deployed it only needs to get incremental updates, it works fine on my localhost but then i deploy it and either only part of the data shows up in the db, or I get an application error and again only part of the data shows up lol
  • a

    AA

    05/27/2023, 6:38 PM
    this does not list the 2023-05-15 compatibility date. https://developers.cloudflare.com/workers/platform/compatibility-dates/
  • a

    AA

    05/27/2023, 6:41 PM
    cursor has some interesting things to say

    https://cdn.discordapp.com/attachments/779390076219686943/1112088194704490546/image.pngâ–¾

  • i

    IdkWhatever69

    05/27/2023, 6:49 PM
    what happened? [cron triggers] no i didn't change the code

    https://cdn.discordapp.com/attachments/779390076219686943/1112090314157604914/Screenshot_2023-05-28_at_12.18.51_AM.pngâ–¾

  • w

    Walshy | Pages

    05/27/2023, 6:51 PM
    ¯\_(ツ)_/¯
  • w

    Walshy | Pages

    05/27/2023, 6:51 PM
    you'd need to check logs
1...250325042505...2509Latest