Phase 3A: Site runtime foundation — Akka cluster, SQLite persistence, Deployment Manager singleton, Instance Actor
- WP-1: Site cluster config (keep-oldest SBR, down-if-alone, 2s/10s failure detection) - WP-2: Site-role host bootstrap (no Kestrel, SQLite paths) - WP-3: SiteStorageService with deployed_configurations + static_attribute_overrides tables - WP-4: DeploymentManagerActor as cluster singleton with staggered Instance Actor creation, OneForOneStrategy/Resume supervision, deploy/disable/enable/delete lifecycle - WP-5: InstanceActor with attribute state, GetAttribute/SetAttribute, SQLite override persistence - WP-6: CoordinatedShutdown verified for graceful singleton handover - WP-7: Dual-node recovery (both seed nodes, min-nr-of-members=1) - WP-8: 31 tests (storage CRUD, actor lifecycle, supervision, negative checks) 389 total tests pass, zero warnings.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
namespace ScadaLink.SiteRuntime.Persistence;
|
||||
|
||||
/// <summary>
|
||||
/// Hosted service that initializes the SQLite schema on startup.
|
||||
/// Runs before the Akka actor system starts creating actors.
|
||||
/// </summary>
|
||||
public class SiteStorageInitializer : IHostedService
|
||||
{
|
||||
private readonly SiteStorageService _storage;
|
||||
|
||||
public SiteStorageInitializer(SiteStorageService storage)
|
||||
{
|
||||
_storage = storage;
|
||||
}
|
||||
|
||||
public async Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
await _storage.InitializeAsync();
|
||||
}
|
||||
|
||||
public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
|
||||
}
|
||||
Reference in New Issue
Block a user