Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mtmk committed Aug 22, 2023
1 parent a3099ed commit c03ba31
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sandbox/Example.JetStream.PullConsumer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class State : INatsJSSubState
private readonly long _expires;
private readonly long _idle;
private readonly Timer _timer;
private readonly TimeSpan _timeout;
private readonly int _timeout;
private int _pending;
private volatile INatsJSSub? _sub;

Expand All @@ -59,7 +59,7 @@ public State(int batch, TimeSpan expires, TimeSpan idle)
_batch = batch;
_expires = expires.ToNanos();
_idle = idle.ToNanos();
_timeout = idle * 2;
_timeout = (int)(idle * 2).TotalMilliseconds;
_pending = _batch;

_timer = new Timer(
Expand Down Expand Up @@ -113,7 +113,7 @@ public ValueTask ReceivedControlMsgAsync(NatsJSControlMsg controlMsg)
public void ResetHeartbeatTimer()
{
// Console.WriteLine($"RESET HB");
_timer.Change(_timeout, _timeout);
_timer.Change(_timeout, Timeout.Infinite);
}

public void ReceivedUserMsg()
Expand Down

0 comments on commit c03ba31

Please sign in to comment.