CountActiveVCSProviderUsers counts active VCS provider users in the workspace.
(ctx context.Context, workspace string, activeWindow time.Duration)
| 37 | |
| 38 | // CountActiveVCSProviderUsers counts active VCS provider users in the workspace. |
| 39 | func (s *Store) CountActiveVCSProviderUsers(ctx context.Context, workspace string, activeWindow time.Duration) (int, error) { |
| 40 | var count int |
| 41 | if err := s.GetDB().QueryRowContext(ctx, countActiveVCSProviderUsersSQL, workspace, activeWindow.Seconds()).Scan(&count); err != nil { |
| 42 | return 0, errors.Wrapf(err, "failed to count active VCS provider users") |
| 43 | } |
| 44 | return count, nil |
| 45 | } |
| 46 | |
| 47 | // TouchVCSProviderUser refreshes an active VCS provider user, or inserts/reactivates |
| 48 | // one when doing so would not exceed the active user limit. |