Skip to content

Commit

Permalink
Add 60 second timeout for FCM requests
Browse files Browse the repository at this point in the history
  • Loading branch information
link2xt committed Jul 31, 2024
1 parent ba21f67 commit f45b046
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ impl State {
fcm_key_path: String,
) -> Result<Self> {
let schedule = Schedule::new(db)?;
let fcm_client = reqwest::Client::new();
let fcm_client = reqwest::ClientBuilder::new()
.timeout(Duration::from_secs(60))
.build()
.context("Failed to build FCM client")?;

let fcm_key: yup_oauth2::ServiceAccountKey =
yup_oauth2::read_service_account_key(fcm_key_path)
Expand Down

0 comments on commit f45b046

Please sign in to comment.