Fix underflow bug when computing time decay

This commit is contained in:
Kiana Sheibani 2023-11-02 14:03:01 -04:00
parent e51f4e2962
commit 6f969cd231
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
2 changed files with 16 additions and 8 deletions

View file

@ -24,7 +24,7 @@ pub struct EventSets {
#[derive(cynic::QueryFragment, Debug)]
#[cynic(variables = "EventSetsVars")]
struct Event {
#[arguments(page: $page, perPage: 50)]
#[arguments(page: $page, perPage: 40, sortType: RECENT)]
sets: Option<SetConnection>,
}
@ -43,6 +43,7 @@ struct PageInfo {
#[derive(cynic::QueryFragment, Debug)]
struct Set {
start_at: Option<Timestamp>,
started_at: Option<Timestamp>,
#[arguments(includeByes: true)]
#[cynic(flatten)]
slots: Vec<SetSlot>,
@ -125,7 +126,7 @@ impl QueryUnwrap<EventSetsVars> for EventSets {
})
.try_collect()?;
Some(SetData {
time: set.start_at?,
time: set.start_at.or(set.started_at)?,
teams,
winner,
})