diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-02-07 19:00:39 -0600 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-02-07 19:00:39 -0600 |
| commit | 2a9c370eed0b94f7773d2d4eca4887155b0835a6 (patch) | |
| tree | fc07c19f39216164e20e1bec4b82ab134e5d57e3 /src/slskd/Integrations | |
| parent | 55376314db7972da453bbded6037f1e1db169a1f (diff) | |
| download | slskd-2a9c370eed0b94f7773d2d4eca4887155b0835a6.tar.gz | |
log when vpn client polling starts and stops
Diffstat (limited to 'src/slskd/Integrations')
| -rw-r--r-- | src/slskd/Integrations/VPN/VPNService.cs | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/slskd/Integrations/VPN/VPNService.cs b/src/slskd/Integrations/VPN/VPNService.cs index 4938e817..dbe7d2c1 100644 --- a/src/slskd/Integrations/VPN/VPNService.cs +++ b/src/slskd/Integrations/VPN/VPNService.cs @@ -78,8 +78,23 @@ public class VPNService : IDisposable private bool Disposed { get; set; } private SemaphoreSlim TimerElapsedLock { get; } = new SemaphoreSlim(1, 1); - public void StartPolling() => Timer?.Start(); - public void StopPolling() => Timer?.Stop(); + public void StartPolling() + { + if (Timer is not null && !Timer.Enabled) + { + Timer.Start(); + Log.Information("VPN client status polling enabled (interval: {Interval}ms)", Timer.Interval); + } + } + + public void StopPolling() + { + if (Timer is not null && Timer.Enabled) + { + Timer.Stop(); + Log.Information("VPN client status polling stopped"); + } + } public void Dispose() { |
