MCPcopy Index your code
hub / github.com/coder/coder / manageGracefulTimeout

Method manageGracefulTimeout

tailnet/controllers.go:1518–1527  ·  view source on GitHub ↗

manageGracefulTimeout allows the gracefulContext to last longer than the main context to allow a graceful disconnect.

()

Source from the content-addressed store, hash-verified

1516// manageGracefulTimeout allows the gracefulContext to last longer than the main context
1517// to allow a graceful disconnect.
1518func (c *Controller) manageGracefulTimeout() {
1519 defer c.cancelGracefulCtx()
1520 <-c.ctx.Done()
1521 timer := c.clock.NewTimer(c.gracefulTimeout, "tailnetAPIClient", "gracefulTimeout")
1522 defer timer.Stop()
1523 select {
1524 case <-c.closedCh:
1525 case <-timer.C:
1526 }
1527}
1528
1529// Run dials the API and uses it with the provided controllers.
1530func (c *Controller) Run(ctx context.Context) {

Callers 1

RunMethod · 0.95

Calls 2

StopMethod · 0.65
DoneMethod · 0.45

Tested by

no test coverage detected