Skip to content

Commit

Permalink
fix: add warning for missing plex token
Browse files Browse the repository at this point in the history
  • Loading branch information
lostb1t committed Jul 13, 2024
1 parent 26becfa commit 0aa81b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ run:
REPLEX_DISABLE_USER_STATE=0 \
REPLEX_ENABLE_CONSOLE=0 \
REPLEX_CACHE_TTL=600 \
REPLEX_NTF_WATCHLIST_FORCE=1 \
RUST_LOG="info,replex=info" \
REPLEX_NTF_WATCHLIST_FORCE=1 \
RUSTFLAGS=-Awarnings \
cargo watch -w src -x run

Expand Down
14 changes: 9 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ use tracing_subscriber::prelude::*;
#[tokio::main]
async fn main() {
let config: Config = Config::figment().extract().unwrap();
if config.host.is_none() {
tracing::error!("REPLEX_HOST is required. Exiting");
return;
}


// set default log level
if let Err(i) = env::var("RUST_LOG") {
env::set_var("RUST_LOG", "info")
Expand Down Expand Up @@ -62,6 +58,14 @@ async fn main() {
// .with(otlp_layer)
.with(fmt_layer)
.init();

if config.host.is_none() {
tracing::error!("REPLEX_HOST is required. Exiting");
return;
}
if config.token.is_none() {
tracing::warn!("REPLEX_TOKEN not defined. Hero art might not load correctly.");
}

// spawn our background task
// let mut plex_client = PlexClient::dummy();
Expand Down

0 comments on commit 0aa81b8

Please sign in to comment.