Skip to content

Commit

Permalink
flo-stats: Override delay secs
Browse files Browse the repository at this point in the history
  • Loading branch information
fluxxu committed Nov 1, 2023
1 parent e41ad5b commit 48488b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion binaries/flo-stats-service/src/graphql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl MutationRoot {
return Err(Error::new("Can not stream a private game."));
}

let delay_secs = if let Some(value) = delay_secs {
let mut delay_secs = if let Some(value) = delay_secs {
if data.is_admin {
value as i64
} else {
Expand All @@ -53,6 +53,11 @@ impl MutationRoot {
180
}
};

if let Some(secs) = game.flo_tv_delay_override_secs.clone() {
delay_secs = secs as i64
}

let delay_secs = if delay_secs == 0 {
None
} else {
Expand Down
2 changes: 2 additions & 0 deletions crates/observer-edge/src/game/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ pub struct GameSnapshot {
pub mask_player_names: bool,
pub is_private: bool,
pub is_live: bool,
pub flo_tv_delay_override_secs: Option<i32>,
}

impl GameSnapshot {
Expand Down Expand Up @@ -204,6 +205,7 @@ impl GameSnapshot {
mask_player_names: game.mask_player_names,
is_private: game.is_private,
is_live: game.is_live,
flo_tv_delay_override_secs: game.flo_tv_delay_override_secs,
}
}
}
Expand Down

0 comments on commit 48488b3

Please sign in to comment.