Load the backtest outcomes before the host is ready (refs #44 #45)
ci / test (postgres) (push) Failing after 4m53s
ci / test (sqlite) (push) Successful in 3m4s
ci / image (push) Skipped

The trading service loaded the outcomes in the background after the host
reported "ready", so for a moment Strategie showed every strategy as
without a backtest. CI run 219 caught it on SQLite. The host now loads
them before it is ready; the call is idempotent, so the one at trading
start changes nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-11 17:01:25 +01:00
1 parent 9ac159a7db
commit dc1ba4e701
1 file changed
+6
+6
View File
@@ -295,6 +295,12 @@ internal sealed partial class AnubisHost(
overrides?.MarketHttp, overrides?.MarketSockets, logger, settings, (password, code, ct) => access.ReauthenticateAsync(password, code, ct),
Path.Combine(Config.Data.Root, "STOP"))
: null;
if (_trading is not null)
{
// Before "ready": the Strategie page must never show a strategy without its backtest outcome (SPEC 12.3).
await _trading.LoadOutcomesAsync(cancellationToken).ConfigureAwait(false);
}
// The laboratory computes on its own thread and reads only local data; the demo shows appendix F and runs none.
_lab = options.Demo ? null : new Laboratory(_db, clock, Config.Data.Research, logger);
_services = new AppServices(_db, settings, secrets, access, backups, scheduler, _market, _trading, _lab);