wrapContextWithoutDeadline wraps context without deadline with default timeout. If deadline is already set, it will be returned as is, and cancel() will be nil. Caller should check if cancel() is nil before calling it.
(ctx context.Context)
| 1256 | // If deadline is already set, it will be returned as is, and cancel() will be nil. |
| 1257 | // Caller should check if cancel() is nil before calling it. |
| 1258 | func (js *jetStream) wrapContextWithoutDeadline(ctx context.Context) (context.Context, context.CancelFunc) { |
| 1259 | if _, ok := ctx.Deadline(); ok { |
| 1260 | return ctx, nil |
| 1261 | } |
| 1262 | return context.WithTimeout(ctx, js.opts.DefaultTimeout) |
| 1263 | } |
| 1264 | |
| 1265 | // CleanupPublisher will cleanup the publishing side of JetStreamContext. |
| 1266 | // |
no outgoing calls
no test coverage detected