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

Method fetchAndLoadDatabaseSince

rest/config.go:1715–1723  ·  view source on GitHub ↗

fetchAndLoadDatabaseSince refreshes all dbConfigs if they where last fetched past the refreshInterval. It then returns found if the fetched configs contain the dbName.

(ctx context.Context, dbName string, refreshInterval *base.ConfigDuration)

Source from the content-addressed store, hash-verified

1713// fetchAndLoadDatabaseSince refreshes all dbConfigs if they where last fetched past the refreshInterval. It then returns found if
1714// the fetched configs contain the dbName.
1715func (sc *ServerContext) fetchAndLoadDatabaseSince(ctx context.Context, dbName string, refreshInterval *base.ConfigDuration) (found bool, err error) {
1716 configs, err := sc.fetchConfigsSince(ctx, refreshInterval)
1717 if err != nil {
1718 return false, err
1719 }
1720
1721 found = configs[dbName] != nil
1722 return found, nil
1723}
1724
1725func (sc *ServerContext) fetchAndLoadDatabase(nonContextStruct base.NonCancellableContext, dbName string, forceReload bool) (found bool, err error) {
1726 sc._databasesLock.Lock()

Callers 1

GetInactiveDatabaseMethod · 0.95

Calls 1

fetchConfigsSinceMethod · 0.95

Tested by

no test coverage detected