mirror of
https://github.com/OMGeeky/yup-oauth2.git
synced 2025-12-26 16:27:25 +01:00
fix(test-svc-acct): Non-lazy cache lookup resulted in two requests.
This commit is contained in:
@@ -25,12 +25,15 @@ fn main() {
|
||||
println!("token is: {:?}", tok);
|
||||
Ok(())
|
||||
});
|
||||
let fut2 = sa
|
||||
.token(["https://www.googleapis.com/auth/pubsub"].iter())
|
||||
.and_then(|tok| {
|
||||
println!("cached token is {:?} and should be identical", tok);
|
||||
Ok(())
|
||||
});
|
||||
let all = fut.join(fut2).then(|_| Ok(()));
|
||||
let mut sa2 = sa.clone();
|
||||
let all = fut
|
||||
.then(move |_| {
|
||||
sa2.token(["https://www.googleapis.com/auth/pubsub"].iter())
|
||||
.and_then(|tok| {
|
||||
println!("cached token is {:?} and should be identical", tok);
|
||||
Ok(())
|
||||
})
|
||||
})
|
||||
.then(|_| Ok(()));
|
||||
tokio::run(all)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user