fix a test
This commit is contained in:
parent
ac21890ab0
commit
f3096d1eb7
|
@ -2592,6 +2592,7 @@ dependencies = [
|
||||||
"mime",
|
"mime",
|
||||||
"patreon",
|
"patreon",
|
||||||
"pfacts",
|
"pfacts",
|
||||||
|
"pretty_env_logger",
|
||||||
"prometheus",
|
"prometheus",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
|
|
|
@ -47,6 +47,7 @@ pfacts = "0"
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
eyre = "0.6"
|
eyre = "0.6"
|
||||||
reqwest = { version = "0.10", features = ["json"] }
|
reqwest = { version = "0.10", features = ["json"] }
|
||||||
|
pretty_env_logger = "0"
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [
|
members = [
|
||||||
|
|
|
@ -71,7 +71,7 @@ pub enum Error {
|
||||||
Request(#[from] reqwest::Error),
|
Request(#[from] reqwest::Error),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
pub struct Credentials {
|
pub struct Credentials {
|
||||||
pub client_id: String,
|
pub client_id: String,
|
||||||
pub client_secret: String,
|
pub client_secret: String,
|
||||||
|
|
|
@ -19,7 +19,7 @@ pub struct Config {
|
||||||
#[instrument]
|
#[instrument]
|
||||||
async fn patrons() -> Result<Option<patreon::Users>> {
|
async fn patrons() -> Result<Option<patreon::Users>> {
|
||||||
use patreon::*;
|
use patreon::*;
|
||||||
let creds: Credentials = envy::prefixed("PATREON_").from_env().unwrap();
|
let creds: Credentials = envy::prefixed("PATREON_").from_env().unwrap_or(Credentials::default());
|
||||||
let cli = Client::new(creds);
|
let cli = Client::new(creds);
|
||||||
|
|
||||||
match cli.campaign().await {
|
match cli.campaign().await {
|
||||||
|
|
Loading…
Reference in New Issue