mirror of
https://github.com/fumiama/terasu-cloudflared.git
synced 2026-06-10 05:04:15 +08:00
TUN-8855: fix lint issues
## Summary Fix lint issues necessary for a subsequent PR. This is only separate to allow a better code review of the actual changes. Closes TUN-8855
This commit is contained in:
committed by
João "Pisco" Fernandes
parent
45f67c23fd
commit
bfdb0c76dc
@@ -103,9 +103,15 @@ func (q *quicConnection) Serve(ctx context.Context) error {
|
||||
// amount of the grace period, allowing requests to finish before we cancel the context, which will
|
||||
// make cloudflared exit.
|
||||
if err := q.serveControlStream(ctx, controlStream); err == nil {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
case <-time.Tick(q.gracePeriod):
|
||||
if q.gracePeriod > 0 {
|
||||
// In Go1.23 this can be removed and replaced with time.Ticker
|
||||
// see https://pkg.go.dev/time#Tick
|
||||
ticker := time.NewTicker(q.gracePeriod)
|
||||
defer ticker.Stop()
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
case <-ticker.C:
|
||||
}
|
||||
}
|
||||
}
|
||||
cancel()
|
||||
|
||||
Reference in New Issue
Block a user