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

Method _fetchDatabase

rest/config.go:1862–1877  ·  view source on GitHub ↗
(ctx context.Context, dbName string)

Source from the content-addressed store, hash-verified

1860}
1861
1862func (sc *ServerContext) _fetchDatabase(ctx context.Context, dbName string) (found bool, dbConfig *DatabaseConfig, err error) {
1863 var cnf DatabaseConfig
1864 callback := func(bucket string) (exit bool, callbackErr error) {
1865 var foundInBucket bool
1866 foundInBucket, cnf, callbackErr = sc._fetchDatabaseFromBucket(ctx, bucket, dbName)
1867 return foundInBucket, callbackErr
1868 }
1869
1870 err = sc.findBucketWithCallback(callback)
1871
1872 if err != nil {
1873 return false, nil, err
1874 }
1875
1876 return true, &cnf, nil
1877}
1878
1879func (sc *ServerContext) handleInvalidDatabaseConfig(ctx context.Context, bucket string, cnf DatabaseConfig) {
1880 sc._databasesLock.Lock()

Callers 2

_fetchAndLoadDatabaseMethod · 0.95
fetchDatabaseMethod · 0.95

Calls 2

Tested by

no test coverage detected