Skip to content
This repository has been archived by the owner on Mar 18, 2023. It is now read-only.

Commit

Permalink
🚑 Crawler: account for nulls in next_check_at
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenein committed Sep 7, 2022
1 parent 371d501 commit 2e40a38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/crawler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ impl Crawler {
last_battle_time: Some(account_info.last_battle_time),
partial_tank_stats,
prio: false,
next_check_at: NextCheckAt::from(account_info.last_battle_time).into(),
next_check_at: Some(NextCheckAt::from(account_info.last_battle_time).into()),
};
let account_snapshot =
database::AccountSnapshot::new(self.realm, &account_info, tank_last_battle_times);
Expand Down
7 changes: 4 additions & 3 deletions src/database/mongodb/models/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ pub struct Account {
#[serde(default)]
pub prio: bool,

/// FIXME: remove `Option` when filled in.
#[serde(rename = "due", default)]
#[serde_as(as = "bson::DateTime")]
pub next_check_at: DateTime,
#[serde_as(as = "Option<bson::DateTime>")]
pub next_check_at: Option<DateTime>,
}

impl TypedDocument for Account {
Expand Down Expand Up @@ -89,7 +90,7 @@ impl Account {
last_battle_time: None,
partial_tank_stats: Vec::new(),
prio: false,
next_check_at: DateTime::default(),
next_check_at: Some(DateTime::default()),
}
}
}
Expand Down

0 comments on commit 2e40a38

Please sign in to comment.