File tree Expand file tree Collapse file tree 2 files changed +2
-5
lines changed
netty/src/main/java/io/grpc/netty
util/src/main/java/io/grpc/util Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -199,8 +199,7 @@ public void updateWindow() throws Http2Exception {
199199 pingReturn ++;
200200 setPinging (false );
201201
202- long currentTickerTimeNanos = ticker .read ();
203- long elapsedTime = Math .max (0L ,(currentTickerTimeNanos - lastPingTime ));
202+ long elapsedTime = (ticker .read () - lastPingTime );
204203 if (elapsedTime == 0 ) {
205204 elapsedTime = 1 ;
206205 }
Original file line number Diff line number Diff line change @@ -148,12 +148,10 @@ public Status acceptResolvedAddresses(ResolvedAddresses resolvedAddresses) {
148148 // On the first go we use the configured interval.
149149 initialDelayNanos = config .intervalNanos ;
150150 } else {
151- long currentTickerTimeNanos = ticker .read ();
152- long elapsedTimeNanos = Math .max (0L ,(currentTickerTimeNanos - detectionTimerStartNanos ));
153151 // If a timer has started earlier we cancel it and use the difference between the start
154152 // time and now as the interval.
155153 initialDelayNanos = Math .max (0L ,
156- config .intervalNanos - elapsedTimeNanos );
154+ config .intervalNanos - Math . max ( 0L ,( ticker . read () - detectionTimerStartNanos )) );
157155 }
158156
159157 // If a timer has been previously created we need to cancel it and reset all the call counters
You can’t perform that action at this time.
0 commit comments