fix(online): honor runtime disable in sync loop to stop OIDC discovery
OnlineSyncService is registered once at startup; toggling the feature off in Settings persisted the flag but never stopped the running loop, so it kept polling and failing OIDC discovery every cycle. Guard TickAsync on the shared config's Enabled flag so disabling takes effect live.
This commit is contained in:
@@ -66,6 +66,12 @@ public sealed class OnlineSyncService : BackgroundService
|
||||
|
||||
internal async Task TickAsync(CancellationToken ct)
|
||||
{
|
||||
// Respect a runtime disable. The hosted service stays registered for the process
|
||||
// lifetime, so toggling the feature off in Settings must stop all sync + auth work
|
||||
// (incl. OIDC discovery) here — otherwise the loop keeps polling until a restart.
|
||||
if (!_config.Enabled)
|
||||
return;
|
||||
|
||||
var token = await _auth.GetAccessTokenAsync(ct);
|
||||
if (token is null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user