Wait for channel to be open after updating secret #1219
Unanswered
sidjakinsboriss
asked this question in
Q&A
Replies: 2 comments 1 reply
-
Which object type |
Beta Was this translation helpful? Give feedback.
0 replies
-
Well, I think, you are talking about Unfortunately, I have never worked with RMQ OAuth2 and can't help you. Probably, you should ask for help in aio-pika original repo by creating Issue with your question. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm using the RabbitMQ OAuth 2.0 authentication backend, and therefore connecting to the broker with access tokens. These tokens can expire, so I have a wrapper around the publishing function that looks somewhat like this:
The issue is that when calling
func
after updating the secret, aChannelInvalidStateError
is raised, since the channel was closed. Addingawait asyncio.sleep(0.01)
before trying to callfunc
again fixes the issue, but seems a bit hacky. Is there some mechanism for waiting until the channel is open again?Beta Was this translation helpful? Give feedback.
All reactions