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)
| 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 |
| 728 | func (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. |
| 746 | func (h *handler) isSilentRequest() bool { |
no test coverage detected