Skip to content

Commit

Permalink
made sure that invalid calendar tokens don't crash the server via an OOM
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed May 10, 2024
1 parent 45f7d04 commit cb1bded
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server/main-api/src/calendar/refresh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ struct LocationKey {
key: String,
}
pub async fn all_entries(pool: &PgPool) {
let client_id_invalid = std::env::var("CONNECTUM_OAUTH_CLIENT_ID").is_err();
let client_secret_invalid = std::env::var("CONNECTUM_OAUTH_CLIENT_SECRET").is_err();
if client_id_invalid || client_secret_invalid {
error!("Please make sure that CONNECTUM_OAUTH_CLIENT_ID and CONNECTUM_OAUTH_CLIENT_SECRET are valid to use calendar features");
return;
}

let mut api = APIRequestor::from(pool);
loop {
let start = Instant::now();
Expand Down

0 comments on commit cb1bded

Please sign in to comment.