Ignore late messages from a replaced engine; list only moves in the morning summary (refs #48 #52)

The guard drill failed once under load. The pipe of the killed engine
delivered a late "running" beat after the restart. The drill took the new
engine as ready and stopped it before it had cancelled the half-done sale
and put the stop back.

The same late message could have made a crash of the new engine look like
a planned stop, which the guard never restarts. Each engine the guard starts
now has a number, and messages from a replaced one are ignored. The drill
also waits until the restart's work is in the database before it checks.

The morning Telegram summary listed every job due today, including the
background ones that run every minute. It now lists only the bot's moves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-11 20:34:25 +01:00
1 parent e96ca70a1a
commit 9ae107000b
4 files changed
+71 -4

No files matched your search

+2 -2
View File
@@ -140,8 +140,8 @@ internal sealed class TelegramDesk(AnubisHost host) : ITelegramDesk
text.AppendLine(Positions(overview.Positions, overview.PositionsWithoutStop));
var local = TimeZoneInfo.ConvertTime(now, Zone).Date;
var today = overview.Next.Count == 0 ? [] : services.Scheduler.Upcoming(20)
.Where(u => TimeZoneInfo.ConvertTime(u.DueUtc, Zone).Date == local)
var today = overview.Next.Count == 0 ? [] : services.Scheduler.Upcoming(200)
.Where(u => u.IsMove && TimeZoneInfo.ConvertTime(u.DueUtc, Zone).Date == local)
.Select(u => TimeZoneInfo.ConvertTime(u.DueUtc, Zone).ToString("HH:mm", System.Globalization.CultureInfo.InvariantCulture) + " " + u.Description)
.ToList();
if (today.Count > 0)