diff --git a/src/ZB.MOM.WW.ScadaBridge.Host/Program.cs b/src/ZB.MOM.WW.ScadaBridge.Host/Program.cs index d658e7fb..4ef81823 100644 --- a/src/ZB.MOM.WW.ScadaBridge.Host/Program.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Host/Program.cs @@ -403,10 +403,10 @@ try var apiRepo = scope.ServiceProvider.GetRequiredService(); var executor = app.Services.GetRequiredService(); var methods = await apiRepo.GetAllApiMethodsAsync(); - foreach (var method in methods) - { - executor.CompileAndRegister(method); - } + // Parallel: CompileAndRegister is safe for concurrent callers (ConcurrentDictionary + // caches, no shared mutable compile state); serial Roslyn compiles stretch the + // failover-recovery window at hundreds of methods (arch-review PLAN-06 Task 7). + Parallel.ForEach(methods, method => executor.CompileAndRegister(method)); } await app.RunAsync();