MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / removeCorruptConfigIfExists

Method removeCorruptConfigIfExists

rest/handler.go:728–743  ·  view source on GitHub ↗

removeCorruptConfigIfExists will remove the config from the bucket and remove it from the map if it exists on the invalid database config map

(ctx context.Context, bucket, configGroupID, dbName string)

Source from the content-addressed store, hash-verified

726
727// removeCorruptConfigIfExists will remove the config from the bucket and remove it from the map if it exists on the invalid database config map
728func (h *handler) removeCorruptConfigIfExists(ctx context.Context, bucket, configGroupID, dbName string) error {
729 _, ok := h.server.invalidDatabaseConfigTracking.exists(dbName)
730 if !ok {
731 // exit early of it doesn't exist
732 return nil
733 }
734 // remove the bad config from the bucket
735 err := h.server.BootstrapContext.DeleteConfig(ctx, bucket, configGroupID, dbName)
736 if err != nil && !base.IsDocNotFoundError(err) {
737 return err
738 }
739 // delete the database name form the invalid database map on server context
740 h.server.invalidDatabaseConfigTracking.remove(dbName)
741
742 return nil
743}
744
745// isSilentRequest returns true if the handler represents a request we should suppress http logging on.
746func (h *handler) isSilentRequest() bool {

Callers 1

handleCreateDBMethod · 0.95

Calls 4

IsDocNotFoundErrorFunction · 0.92
existsMethod · 0.80
DeleteConfigMethod · 0.65
removeMethod · 0.45

Tested by

no test coverage detected