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

Method ReloadUser

db/database_collection.go:276–289  ·  view source on GitHub ↗

ReloadUser the User object, in case its persistent properties have been changed. This code does not lock and is not safe to call from concurrent goroutines.

(ctx context.Context)

Source from the content-addressed store, hash-verified

274
275// ReloadUser the User object, in case its persistent properties have been changed. This code does not lock and is not safe to call from concurrent goroutines.
276func (c *DatabaseCollectionWithUser) ReloadUser(ctx context.Context) error {
277 if c.user == nil {
278 return nil
279 }
280 user, err := c.Authenticator(ctx).GetUser(c.user.Name())
281 if err != nil {
282 return err
283 }
284 if user == nil {
285 return fmt.Errorf("User not found during reload")
286 }
287 c.user = user
288 return nil
289}
290
291// RemoveFromChangeCache removes select documents from all channel caches and returns the number of documents removed.
292func (c *DatabaseCollection) RemoveFromChangeCache(ctx context.Context, docIDs []string, startTime time.Time) int {

Callers 2

checkForUserUpdatesMethod · 0.95

Calls 4

GetUserMethod · 0.80
ErrorfMethod · 0.80
NameMethod · 0.65
AuthenticatorMethod · 0.45

Tested by

no test coverage detected