_fetchAndLoadDatabase will attempt to find the given database name first in a matching bucket name, but then fall back to searching through configs in each bucket to try and find a config.
(nonContextStruct base.NonCancellableContext, dbName string, forceReload bool)
| 1731 | // _fetchAndLoadDatabase will attempt to find the given database name first in a matching bucket name, |
| 1732 | // but then fall back to searching through configs in each bucket to try and find a config. |
| 1733 | func (sc *ServerContext) _fetchAndLoadDatabase(nonContextStruct base.NonCancellableContext, dbName string, forceReload bool) (found bool, err error) { |
| 1734 | found, dbConfig, err := sc._fetchDatabase(nonContextStruct.Ctx, dbName) |
| 1735 | if err != nil || !found { |
| 1736 | return false, err |
| 1737 | } |
| 1738 | if forceReload { |
| 1739 | // setting the config cas to 0 will force the reload of the config from the further down stack |
| 1740 | dbConfig.cfgCas = 0 |
| 1741 | } |
| 1742 | sc._applyConfigs(nonContextStruct.Ctx, map[string]DatabaseConfig{dbName: *dbConfig}, false, false) |
| 1743 | |
| 1744 | return true, nil |
| 1745 | } |
| 1746 | |
| 1747 | // migrateV30Configs checks for configs stored in the 3.0 location, and migrates them to the db registry |
| 1748 | func (sc *ServerContext) migrateV30Configs(ctx context.Context) error { |
no test coverage detected