MCPcopy Create free account
hub / github.com/cortexproject/cortex / RestoreConfig

Method RestoreConfig

pkg/configs/db/postgres/postgres.go:327–333  ·  view source on GitHub ↗

RestoreConfig restores configuration.

(ctx context.Context, userID string)

Source from the content-addressed store, hash-verified

325
326// RestoreConfig restores configuration.
327func (d DB) RestoreConfig(ctx context.Context, userID string) error {
328 cfg, err := d.GetConfig(ctx, userID)
329 if err != nil {
330 return err
331 }
332 return d.SetDeletedAtConfig(ctx, userID, sql.NullTime{}, cfg.Config)
333}
334
335// Transaction runs the given function in a postgres transaction. If fn returns
336// an error the txn will be rolled back.

Callers

nothing calls this directly

Implementers 4

timedpkg/configs/db/timed.go
tracedpkg/configs/db/traced.go
DBpkg/configs/db/postgres/postgres.go
DBpkg/configs/db/memory/memory.go

Calls 2

GetConfigMethod · 0.95
SetDeletedAtConfigMethod · 0.95

Tested by

no test coverage detected