Skip to content

Commit

Permalink
create required challenge index
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed May 13, 2021
1 parent 5d6f17d commit 5a3417c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 4 additions & 0 deletions bin/mongodb/indexes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
db.challenge.createIndex(
{ seenAt: 1 },
{ partialFilterExpression: { status: 10, timeControl: { $exists: true }, seenAt: { $exists: true } } }
);
3 changes: 0 additions & 3 deletions modules/challenge/src/main/ChallengeRepo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ final private class ChallengeRepo(colls: ChallengeColls, maxPerUser: Max)(implic
.hint(coll hint $doc("seenAt" -> 1)) // partial index
.cursor[Challenge]()
.list(max)
.recoverWith { case _: reactivemongo.core.errors.DatabaseException =>
coll.list[Challenge](selector, max)
}
}

private[challenge] def expired(max: Int): Fu[List[Challenge]] =
Expand Down

0 comments on commit 5a3417c

Please sign in to comment.