fix: Don't panic when token update fails
* fix a panic when token update fails sometimes we get an `Err` from `token_rx.recv()`, shouldn't panic in such cases * chore(docs): Update Changelog --------- Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
This commit is contained in:
committed by
GitHub
parent
b70df761f7
commit
9a26c58f8e
@@ -102,7 +102,7 @@ impl WebApi {
|
||||
let api_token = self.api.token.clone();
|
||||
let api_token_expiration = self.token_expiration.clone();
|
||||
Some(ASYNC_RUNTIME.get().unwrap().spawn_blocking(move || {
|
||||
if let Some(token) = token_rx.recv().unwrap() {
|
||||
if let Ok(Some(token)) = token_rx.recv() {
|
||||
*api_token.lock().unwrap() = Some(Token {
|
||||
access_token: token.access_token,
|
||||
expires_in: chrono::Duration::seconds(token.expires_in.into()),
|
||||
|
||||
Reference in New Issue
Block a user