https://discord.cloudflare.com logo
Join Discord
Powered by
# durable-objects
  • t

    ttraenkler

    05/28/2021, 2:22 PM
    Thanks, I have reported the issue regarding the missing __STATIC_CONTENT_MANIFEST env here: https://github.com/cloudflare/wrangler/issues/1938 /cc @User
  • j

    James

    05/28/2021, 2:56 PM
    Thanks for diving into this!
  • v

    Vanessa🦩

    05/28/2021, 3:16 PM
    So … did the team chat reveal anything?
  • e

    Erwin

    05/28/2021, 3:17 PM
    People are just waking up now. And I need to go to bed now. Hopefully have something tomorrow.
  • v

    Vanessa🦩

    05/28/2021, 3:18 PM
    Okay, thanks. Good night!
  • g

    Greg-McKeon

    05/28/2021, 5:05 PM
    @User yep, there's a hard limit at 10,000. we're looking into increasing the limit for long-running WebSocket connections.
  • d

    Deebster

    05/28/2021, 5:06 PM
    and this limit is for the DO across all of the connected workers?
  • d

    Deebster

    05/28/2021, 5:07 PM
    i.e. it's cumulative: 100 from 100 connections = max
  • v

    Vanessa🦩

    05/28/2021, 5:43 PM
    In my case, no timeout is long-lived, 30s max. So if you were rolling-over the IDs, that would be fine (but probably not spec-compliant). Without rollover, I'd need a few million at least (e.g. 100/s over 10 hours, and after that I'd prefer the DO to be restarted).
  • v

    Vanessa🦩

    05/28/2021, 5:43 PM
    I haven't tested, but I guess the limit applies to
    setInterval
    just the same?
  • v

    Vanessa🦩

    05/28/2021, 5:51 PM
    Also, is there a recommended work-around for the
    Cannot clear a timeout created in a different request context
    error? All of my timeouts need to be clearable.
  • v

    Vanessa🦩

    05/28/2021, 7:01 PM
    My current workaround is this https://gist.github.com/codefrau/cd7d25ee88f034c71bba9cf6ba51f9b7
  • n

    newtack

    05/28/2021, 10:44 PM
    Is there a way to perform a full/partial backup/restore of what is in DO?
  • t

    Taral

    05/28/2021, 11:46 PM
    Why do the examples trigger lazy init on first request instead of doing async init in the constructor?
  • e

    Erwin

    05/29/2021, 1:10 AM
    Great question. There are 2 reasons, firstly that a constructor has to be synchronous, and secondly that it does not matter in practice, because the fetch method is always called immediately after invoking the constructor and doing it in the fetch method means that it much easier to retry in case of a failure.
  • e

    Erwin

    05/29/2021, 1:11 AM
    Of course it is always possible to do that yourself now, we currently do not have this type of functionality yet.
  • t

    Taral

    05/29/2021, 1:35 AM
    My thought is that the constructor is only called once. So if you start the operation in the constructor and await that promise in the fetch, the code is a bit simpler. 🙂
  • e

    Erwin

    05/29/2021, 1:37 AM
    That is absolutely possible and was my reaction too. But that way you have no recourse if the initialisation fails.
  • e

    Erwin

    05/29/2021, 1:38 AM
    Unless you start it in the constructor and restart it in the fetch method on a fail. But now your code is more complex again than always starting it in fetch.
  • g

    Greg Brimble | Cloudflare Pages

    05/29/2021, 8:10 AM
    Is it planned? And/or anything similar for KV?
  • e

    Erwin

    05/29/2021, 8:56 AM
    We don't really talk much about the roadmap publicly because everything changes all the time right? But from an KV pov you should totally bug @User for a sneak peak about something he is working on 🙂
  • g

    Greg Brimble | Cloudflare Pages

    05/29/2021, 10:27 AM
    Ooh, that's exciting! Yeah, would love to see what you're working on @User 🙂
  • v

    Vanessa🦩

    05/29/2021, 4:26 PM
    bump
  • v

    Vanessa🦩

    05/29/2021, 4:44 PM
    Also, is DO eviction documented somewhere? Can I perform a last action (e.g. store) before being evicted (similar to beforeUnload/sendBeacon)? In case of code upgrade, can I be sure that web socket connections to the old instance are closed before the first request is handled by the new instance?
  • m

    mvp-joe

    05/29/2021, 5:08 PM
    I am seeing an issue with
    storage.list
    and
    storage.get
    (multiple). I always get back an empty map when I call
    storage.list
    (with options or without) or when I call
    storage.get
    with an array of keys. For context, I am able to get and store items - with
    storage.put
    and single item
    storage.get
    . So I know the items are stored and that it is working. It is just retrieving multiple items that seems to be an issue. Is anyone else seeing that?
  • m

    mvp-joe

    05/29/2021, 5:10 PM
    For example, here is a call that is using an array of keys:
  • m

    mvp-joe

    05/29/2021, 5:10 PM
    Calling get with any one of those keys returns the object, but calling it with the array of keys returns an empty map.
  • v

    Vanessa🦩

    05/29/2021, 5:26 PM
    try
    JSON.stringify([…items])
  • m

    mvp-joe

    05/29/2021, 5:28 PM
    that worked, thanks @User
  • c

    Chinoman10

    05/29/2021, 6:28 PM
    Copy code
    js
    let stuff = await namespace.list()
    console.log(stuff.keys)
    return await stuff.keys
    You need to add
    .keys
    to the object that's returned from the
    .list()
    🙂
1...919293...567Latest