Skip to content

Commit

Permalink
fix wrong condition in time shift warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Felk committed Oct 20, 2024
1 parent e00bcc6 commit 5b8ea42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion TPP.Twitch.EventSub/EventSubClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public async Task<DisconnectReason> ConnectAndReceive(CancellationToken cancella
}
Instant clientNow = _clock.GetCurrentInstant();
Duration clientServerTimeShift = clientNow - message.Metadata.MessageTimestamp;
if (clientServerTimeShift < KeepAliveGrace || clientServerTimeShift > KeepAliveGrace)
if (clientServerTimeShift < -KeepAliveGrace || clientServerTimeShift > KeepAliveGrace)
{
_logger.LogWarning(
"Client time is {Shift}s ahead of server time: Received message with timestamp {ServerTimestamp}, " +
Expand Down

0 comments on commit 5b8ea42

Please sign in to comment.