From 476763055cbb568c52dcd8e984df01a057c1ab74 Mon Sep 17 00:00:00 2001 From: Angelo Breuer Date: Thu, 4 Jan 2024 20:14:16 +0100 Subject: [PATCH 1/3] fix(inactivity-tracking): Fix poll interval not initialized when tracker lifetime created --- .../InactivityTrackingService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Lavalink4NET.InactivityTracking/InactivityTrackingService.cs b/src/Lavalink4NET.InactivityTracking/InactivityTrackingService.cs index fd564deb..33e03eaf 100644 --- a/src/Lavalink4NET.InactivityTracking/InactivityTrackingService.cs +++ b/src/Lavalink4NET.InactivityTracking/InactivityTrackingService.cs @@ -73,7 +73,7 @@ IInactivityTrackerLifetime CreateLifetime(IInactivityTracker inactivityTracker) if (trackerOptions.Mode is InactivityTrackerMode.Polling) { - var pollInterval = trackerOptions.PollInterval ?? _defaultPollInterval; + var pollInterval = trackerOptions.PollInterval ?? options.Value.DefaultPollInterval; return new PollingInactivityTrackerLifetime( label, From 4b0ea4cb1150b1516da53ceeec413d5f3270a627 Mon Sep 17 00:00:00 2001 From: Angelo Breuer Date: Thu, 4 Jan 2024 20:15:43 +0100 Subject: [PATCH 2/3] feat(inactivity-tracking): Allow longer timeouts for inactivity tracking --- .../InactivityTrackerEntry.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Lavalink4NET.InactivityTracking/InactivityTrackerEntry.cs b/src/Lavalink4NET.InactivityTracking/InactivityTrackerEntry.cs index 13994ce0..59166aa9 100644 --- a/src/Lavalink4NET.InactivityTracking/InactivityTrackerEntry.cs +++ b/src/Lavalink4NET.InactivityTracking/InactivityTrackerEntry.cs @@ -4,13 +4,13 @@ public readonly struct InactivityTrackerEntry(DateTimeOffset inactiveSince, TimeSpan? timeout = null) { - private readonly int _timeoutValue = timeout.HasValue - ? (int)timeout.Value.TotalMilliseconds + private readonly long _timeoutValue = timeout.HasValue + ? timeout.Value.Ticks : -1; public TimeSpan? Timeout => _timeoutValue < 0 ? null - : TimeSpan.FromMilliseconds(_timeoutValue); + : TimeSpan.FromTicks(_timeoutValue); public DateTimeOffset InactiveSince { get; } = inactiveSince; } From 50b0d33216592e48f2e74126a766b700261bcd25 Mon Sep 17 00:00:00 2001 From: Angelo Breuer Date: Thu, 4 Jan 2024 20:16:09 +0100 Subject: [PATCH 3/3] chore: Bump version (4.0.3) --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 22e832f1..5d463ea6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: run: dotnet restore src/Lavalink4NET.sln - name: Build - run: dotnet build src/Lavalink4NET.sln --no-restore --configuration ${{ matrix.configuration }} /property:Version=4.0.2 + run: dotnet build src/Lavalink4NET.sln --no-restore --configuration ${{ matrix.configuration }} /property:Version=4.0.3 - name: Run tests working-directory: ci