File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed
src/SharedKernel/Maintenance Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 33
44namespace SharedKernel . Maintenance ;
55
6+ //This is for local cache entity to poll the maintenance mode from distributed cache
7+ //This should be removed then L1 + L2 cache is implemented in hybrid cache
68internal class MaintenanceCachePoller ( HybridCache hybridCache , MaintenanceState state ) : BackgroundService
79{
810 protected override async Task ExecuteAsync ( CancellationToken stoppingToken )
Original file line number Diff line number Diff line change @@ -5,11 +5,4 @@ public enum MaintenanceMode
55 Disabled = 0 ,
66 EnabledForClients = 1 ,
77 EnabledForAll = 2
8- }
9-
10- //This is for local cache entity to poll the maintenance mode from distributed cache
11- //This should be removed then L1 + L2 cache is implemented in hybrid cache
12-
13- // This is a local cache entity to hold the maintenance mode in memory
14- // This should be removed then L1 + L2 cache is implemented in hybrid cache
15- // thread-safe local snapshot
8+ }
Original file line number Diff line number Diff line change 22
33namespace SharedKernel . Maintenance ;
44
5+ // This is a local cache entity to hold the maintenance mode in memory
6+ // This should be removed then L1 + L2 cache is implemented in hybrid cache
7+ // thread-safe local snapshot
58public sealed class MaintenanceState ( HybridCache cache )
69{
710 private const string Key = "maintenance-mode" ;
@@ -16,7 +19,6 @@ public MaintenanceMode Mode
1619 // for admin/API to change mode (updates local immediately, then L2)
1720 public async Task SetModeAsync ( MaintenanceMode mode , CancellationToken ct = default )
1821 {
19- Mode = mode ;
2022 await cache . SetAsync (
2123 Key ,
2224 new MaintenanceCacheEntity
@@ -30,6 +32,8 @@ await cache.SetAsync(
3032 Flags = null
3133 } ,
3234 cancellationToken : ct ) ;
35+
36+ Mode = mode ;
3337 }
3438
3539 // used by the poller only
You can’t perform that action at this time.
0 commit comments