SeededHealthState.cs
515 bytes
| 1 | namespace SplitApp.UsersService.Hosting; |
|---|---|
| 2 | |
| 3 | /// <summary> |
| 4 | /// Tiny singleton flag flipped by Program.cs after `UseUsersModule()` (migrate + seed) finishes. |
| 5 | /// Read by <see cref="Controllers.HealthController"/> so the compose healthcheck reports |
| 6 | /// "starting" until seeding is done — webapp's depends_on: service_healthy then unblocks cleanly. |
| 7 | /// </summary> |
| 8 | public class SeededHealthState |
| 9 | { |
| 10 | private volatile bool _seeded; |
| 11 | public bool IsSeeded => _seeded; |
| 12 | public void MarkSeeded() => _seeded = true; |
| 13 | } |
| 14 | |