the namespace is set when the timescale listenstore starts.
so, my keys have namespaces set -- should be ok, no?
_lucifer
let me check and get back that to you
regarding str pass decode=True
what type do you want bytes or str?
ruaok
str
but I don't really want me keys to be encoded. there is no need.
_lucifer
yes, then pass encode=True and decode=True
alastairp
encode/decode is for the value, not the key
we don't encode keys any more
ruaok
understood, for the value.
_lucifer
that change will come in LB once we upgrade BU
(not encoding keys)
ruaok is really confused now.
alastairp
maybe we're talking about a few different things
ruaok
can one of you please tell me the correct and future proof way to set/get keys?
ideally no encoded that we don't have to rescan the DB when new BU is deployed.
_lucifer
pass both encode and decode=True
ruaok
and that will currently encode my values?
sot that will require a flush of all the values when the new BU comes?
_lucifer
yes that will correctly encode the values.
ruaok
(which is EXPENSIVE!)
_lucifer
i am not sure regarding the flush because the change is to encoding of keys not values. maybe alastairp can tell about that.
alastairp
no, you won't need to do anything when a new BU comes
ruaok
wow, this convo keeps getting worse. ;
_lucifer
we should prbably do the new BU upgrade soon. to avoid such confusions.
alastairp
the endode/decode flags are to take whatever value you pass into cache.set() and serialise it using msgpack. this means that you get out exactly what you get in
this is the default and the cache has always worked like this
we're not changing this behaviour in the upgrades to BU
ruaok
yes, but does one return str() and the other bytes() ?
alastairp
yes, because the redis python library returns bytes. If you don't ask it to decode the value, you get the bytes back
get(..., decode=True) returns a string, get(..., decode=False) return bytes
ruaok
so, when the decode/encode flags go away we will always return bytes?
thanks. "github actions" shows 0 because it seems that it only tracks actions on private repos (public repos are free). Based on their docs I'd expect "Storage for actions and packages" to show our cache usage
but if that shows 0 then that's fine
_lucifer: I like that output!
ruaok
I see that brainzutils cache increment does not have the ability to increment by more than 1.
I need to do that, however. should I just make multiple calls or set a new value?
in theory the latter can cause a race condition, but we only have one piece of code that inserts new listens right now, so it should never happen.
thoughts, alastairp, _lucifer ?
alastairp
mm
ruaok: which method?
ruaok
increment
alastairp
I think that's a bug
we should expose INCRBY
ruaok
that would be ideal
alastairp
for now, can you either loop through, or manually call cache._r.incrby?