fix(phase-4): close review notes — drop dead var, sync UI cron default

Phase 4 reviewer (Sonnet) flagged two 🟡 warnings; both addressed:

1. PullLiveOddsUseCase: removed dead 'liveEvents' assignment that called
   ScrapeUpcomingAsync but never read the result. Replaced misleading
   comment block with a single TODO(phase-6/8) note pointing to the
   ListLiveAsync(cutoff) follow-up.
2. Marathon.UI.Services.WorkerOptions.UpcomingScheduleCron: changed default
   from '0 */5 * * * *' (every 5 min) to '0 0 */6 * * *' (every 6 hours)
   to match Marathon.Infrastructure.Configuration.WorkerOptions and the
   appsettings.json default.

PLAN.md: Phase 4 row updated (review status, commit hash); top-level
checkbox in Phases list ticked.

Build 0/0, all 202 tests still passing.
This commit is contained in:
2026-05-05 12:35:01 +03:00
parent 2acbaa5b77
commit fe97643a41
3 changed files with 8 additions and 10 deletions
@@ -36,13 +36,11 @@ public sealed class PullLiveOddsUseCase
{
_logger.LogInformation("PullLiveOddsUseCase: cycle started");
// Fetch live events from scraper — returns only events currently live on site.
var liveEvents = await _scraper.ScrapeUpcomingAsync(sportFilter: null, ct);
// Note: the scraper's ScrapeUpcomingAsync returns pre-match by default.
// For the live cycle, we load known events from the DB and refresh each one.
// The "live vs pre-match" distinction is handled by OddsSource.Live in the snapshot.
// We use the DB list because the site's live listing may differ from what we track.
// Refresh odds for every event we already track. The "live vs pre-match"
// distinction is recorded by stamping each snapshot with OddsSource.Live.
// TODO(phase-6/8): once IEventRepository.ListLiveAsync(cutoff) ships, swap
// this for a filter that only returns currently-live events to avoid
// hammering the scraper with non-live IDs.
var allEvents = await _eventRepo.ListAsync(ct);
int snapshotsCaptured = 0;
+1 -1
View File
@@ -9,7 +9,7 @@ public sealed class WorkerOptions
public const string SectionName = "Workers";
/// <summary>Cron expression that drives the upcoming-schedule poller.</summary>
public string UpcomingScheduleCron { get; set; } = "0 */5 * * * *";
public string UpcomingScheduleCron { get; set; } = "0 0 */6 * * *";
/// <summary>Whether the live odds poller should run at startup.</summary>
public bool LivePollerEnabled { get; set; } = true;