mirror of
https://github.com/OMGeeky/yup-oauth2.git
synced 2026-01-20 01:00:59 +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);
|
println!("token is: {:?}", tok);
|
||||||
Ok(())
|
Ok(())
|
||||||
});
|
});
|
||||||
let fut2 = sa
|
let mut sa2 = sa.clone();
|
||||||
.token(["https://www.googleapis.com/auth/pubsub"].iter())
|
let all = fut
|
||||||
.and_then(|tok| {
|
.then(move |_| {
|
||||||
println!("cached token is {:?} and should be identical", tok);
|
sa2.token(["https://www.googleapis.com/auth/pubsub"].iter())
|
||||||
Ok(())
|
.and_then(|tok| {
|
||||||
});
|
println!("cached token is {:?} and should be identical", tok);
|
||||||
let all = fut.join(fut2).then(|_| Ok(()));
|
Ok(())
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.then(|_| Ok(()));
|
||||||
tokio::run(all)
|
tokio::run(all)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user