Skip to content

Commit

Permalink
Merge pull request #196 from peppy/fix-watch-mode-not-waiting-pp
Browse files Browse the repository at this point in the history
Fix some entries not waiting for performance population before importing
  • Loading branch information
bdach authored Jan 3, 2024
2 parents 64c2a6f + edd4927 commit 7f2c106
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public class HighScore
public bool hidden { get; set; }
public string country_acronym { get; set; } = null!;

// This comes from score_process_queue. Used in join context.
// These come from score_process_queue. Used in join context.
public uint? queue_id { get; set; }
public byte? status { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,15 @@ public async Task<int> OnExecuteAsync(CancellationToken cancellationToken)
.OrderBy(s => s.queue_id)
.ToArray();

var pendingProcessing = highScores.FirstOrDefault(s => s.status == 0);

if (pendingProcessing != null)
{
Console.WriteLine($"Waiting on processing of (score_id: {pendingProcessing.score_id} queue_id: {pendingProcessing.queue_id})");
Thread.Sleep(500);
continue;
}

if (highScores.Length == 0)
{
Thread.Sleep(500);
Expand Down

0 comments on commit 7f2c106

Please sign in to comment.