Skip to content

Commit 9ad187d

Browse files
committed
move rotator out of coderd
1 parent 6432b0d commit 9ad187d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cli/server.go

+6
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,12 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
746746
return xerrors.Errorf("set deployment id: %w", err)
747747
}
748748

749+
// Start a background process that rotates keys.
750+
err = cryptokeys.StartRotator(ctx, options.Logger.Named("keyrotator"), options.Database)
751+
if err != nil {
752+
return xerrors.Errorf("start key rotator: %w", err)
753+
}
754+
749755
fetcher := &cryptokeys.DBFetcher{
750756
DB: options.Database,
751757
}

coderd/coderd.go

-6
Original file line numberDiff line numberDiff line change
@@ -449,12 +449,6 @@ func New(options *Options) *API {
449449
panic(xerrors.Errorf("get deployment ID: %w", err))
450450
}
451451

452-
// Start a background process that rotates keys.
453-
err = cryptokeys.StartRotator(ctx, options.Logger.Named("keyrotator"), options.Database)
454-
if err != nil {
455-
options.Logger.Fatal(ctx, "start key rotator", slog.Error(err))
456-
}
457-
458452
fetcher := &cryptokeys.DBFetcher{
459453
DB: options.Database,
460454
}

0 commit comments

Comments
 (0)