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

Method start

coderd/cryptokeys/rotate.go:82–92  ·  view source on GitHub ↗

start begins the process of rotating keys. Canceling the context will stop the rotation process.

(ctx context.Context)

Source from the content-addressed store, hash-verified

80// start begins the process of rotating keys.
81// Canceling the context will stop the rotation process.
82func (k *rotator) start(ctx context.Context) {
83 w := k.clock.TickerFunc(ctx, defaultRotationInterval, func() error {
84 err := k.rotateKeys(ctx)
85 if err != nil {
86 k.logger.Error(ctx, "failed to rotate keys", slog.Error(err))
87 }
88 return nil
89 })
90 err := w.Wait()
91 k.logger.Debug(ctx, "stopping key rotation", slog.Error(err))
92}
93
94// rotateKeys checks for any keys needing rotation or deletion and
95// may insert a new key if it detects that a valid one does

Callers 1

StartRotatorFunction · 0.95

Calls 3

rotateKeysMethod · 0.95
WaitMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected