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)
| 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. |
| 276 | func (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. |
| 292 | func (c *DatabaseCollection) RemoveFromChangeCache(ctx context.Context, docIDs []string, startTime time.Time) int { |
no test coverage detected