Implement persistent review queue

This commit is contained in:
hz
2026-07-19 12:51:24 -05:00
parent 1bfb3f5347
commit 7508d4fe1d
20 changed files with 1155 additions and 20 deletions
@@ -18,6 +18,7 @@ public class QuestionsController : ControllerBase
private readonly AnswerStatisticsStore _statistics;
private readonly ServiceMetrics _metrics;
private readonly QuestionBookmarkStore _bookmarks;
private readonly ReviewQueueStore _reviewQueue;
public QuestionsController(
QuestionStore questions,
@@ -26,7 +27,8 @@ public class QuestionsController : ControllerBase
QuestionMediaStore media,
AnswerStatisticsStore statistics,
ServiceMetrics metrics,
QuestionBookmarkStore bookmarks)
QuestionBookmarkStore bookmarks,
ReviewQueueStore reviewQueue)
{
_questions = questions;
_attempts = attempts;
@@ -35,6 +37,7 @@ public class QuestionsController : ControllerBase
_statistics = statistics;
_metrics = metrics;
_bookmarks = bookmarks;
_reviewQueue = reviewQueue;
}
[HttpGet("systems")]
@@ -168,6 +171,7 @@ public class QuestionsController : ControllerBase
{
_metrics.AttemptDuplicate();
}
await _reviewQueue.AddFromFirstAttemptAsync(record.Attempt);
var ratingOwner = Guid.NewGuid().ToString("N");
var shouldRate = await _attempts.TryAcquireRatingLeaseAsync(