Prepare strategies before the host is ready; stop demo servers first (refs #44 #45)
ci / test (postgres) (push) Successful in 4m39s
ci / test (sqlite) (push) Successful in 2m57s
ci / image (push) Successful in 56s
ci / test (postgres) (pull_request) Successful in 5m27s
ci / test (sqlite) (pull_request) Successful in 3m14s
ci / image (pull_request) Successful in 10s
ci / test (postgres) (push) Successful in 4m39s
ci / test (sqlite) (push) Successful in 2m57s
ci / image (push) Successful in 56s
ci / test (postgres) (pull_request) Successful in 5m27s
ci / test (sqlite) (pull_request) Successful in 3m14s
ci / image (pull_request) Successful in 10s
Loading the outcomes before "ready" was not enough: on a fresh database the strategy rows did not exist yet, so the load did nothing and CI run 220 failed the same way on PostgreSQL. The new TradingService.PrepareAsync creates accounts and strategies, then loads the outcomes; the host runs it before it is ready and logs a failure without blocking the interface. StartAsync repeats it, which changes nothing. The demo tests deleted the demo folder while the server still held its SQLite file, which Windows refuses at random. They now stop the server first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
dc1ba4e701
commit
fc5df0146e
5 files changed
+74
-41
No files matched your search
@@ -298,7 +298,15 @@ internal sealed partial class AnubisHost(
|
||||
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);
|
||||
// A failure here is logged and left to the trading start, which repeats it: the interface still opens.
|
||||
try
|
||||
{
|
||||
await _trading.PrepareAsync(cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex) when (ex is not OperationCanceledException)
|
||||
{
|
||||
LogTradingFailed(logger, ex);
|
||||
}
|
||||
}
|
||||
|
||||
// The laboratory computes on its own thread and reads only local data; the demo shows appendix F and runs none.
|
||||
|
||||
Reference in new issue
Block a user