You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tx.zrem seems to function just fine passing in bytes. Problem seems to come from the string formatting on the tx.hdel. The key to delete gets formatted to include the b prefix, "b'g6r6o3gmvlyHWbPC457M4Cvru9J4nd9C':fr", for example. Key w/ the "b" does not exist so it's not. tx.del returns 1, instead of the expected 3.
I'd like to see either an exception raised and/or an error logged in this scenario. I'd be happy to open a PR with a proposal if you're open to it @mlasevich.
to reproduce...
fromrsmqimportRedisSMQqueue=RedisSMQ(host="redis", qname="myqueue", options={"decode_responses": False})
queue.createQueue(delay=0).vt(20).execute()
message_id=queue.sendMessage().message("Hello World").execute()
msg=queue.receiveMessage().exceptions(False).execute()
msg_id_bytes: bytes=msg['id'] # bytes because "decode_responses": Falseresp=queue.deleteMessage(id=msg_id_bytes).execute()
assertrespisTrueclient=queue.client# successfull delete from the zsetzset=client.hgetall("rsmq:myqueue")
assertzset== {}
# keys still in hashclient.hgetall("rsmq:myqueue:Q")
The text was updated successfully, but these errors were encountered:
Passing the message_id in as
bytes
to.deleteMessage
will delete the message from the ZSET but not the HASH when using python3.x.PyRSMQ/src/rsmq/cmd/delete_message.py
Lines 38 to 40 in 8e8221e
tx.zrem
seems to function just fine passing inbytes
. Problem seems to come from the string formatting on thetx.hdel
. The key to delete gets formatted to include theb
prefix,"b'g6r6o3gmvlyHWbPC457M4Cvru9J4nd9C':fr"
, for example. Key w/ the "b" does not exist so it's not.tx.del
returns 1, instead of the expected 3.I'd like to see either an exception raised and/or an error logged in this scenario. I'd be happy to open a PR with a proposal if you're open to it @mlasevich.
to reproduce...
The text was updated successfully, but these errors were encountered: