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

Commit

Permalink
🚧 Crawler: make sure crawler picks up nulls first
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenein committed Sep 7, 2022
1 parent 44aac1f commit 0331f36
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/database/mongodb/models/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl Indexes for Account {
fn indexes() -> Self::I {
[
IndexModel::builder()
.keys(doc! { "rlm": 1, "lbts": -1 })
.keys(doc! { "rlm": 1, "lbts": 1 })
.build(),
IndexModel::builder()
.keys(doc! { "rlm": 1, "aid": 1 })
Expand Down Expand Up @@ -141,13 +141,13 @@ impl Account {
pub async fn retrieve_sample(
from: &Database,
realm: wargaming::Realm,
before: DateTime,
after: DateTime,
sample_size: u32,
) -> Result<Vec<Account>> {
let filter = doc! {
"$and": [
{ "rlm": realm.to_str() },
{ "$or": [ { "lbts": null }, { "lbts": { "$lte": before } } ] }, // TODO: or priority flag set.
{ "$or": [ { "lbts": null }, { "lbts": { "$gte": after } } ] }, // TODO: or priority flag set.
],
};
let options = FindOptions::builder()
Expand Down

0 comments on commit 0331f36

Please sign in to comment.