Skip to content

Commit bf34fdd

Browse files
marhasglbrntt
andauthored
Only schedule a close if the ping was actually sent (#1626)
Co-authored-by: George Barnett <[email protected]>
1 parent eefe83d commit bf34fdd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/GRPC/GRPCIdleHandler.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,9 @@ internal final class GRPCIdleHandler: ChannelInboundHandler {
265265
initialDelay: delay,
266266
delay: delay
267267
) { _ in
268-
self.handlePingAction(self.pingHandler.pingFired())
268+
let action = self.pingHandler.pingFired()
269+
if case .none = action { return }
270+
self.handlePingAction(action)
269271
// `timeout` is less than `interval`, guaranteeing that the close task
270272
// will be fired before a new ping is triggered.
271273
assert(timeout < delay, "`timeout` must be less than `interval`")

0 commit comments

Comments
 (0)