MCPcopy Create free account
hub / github.com/bytebase/bytebase / CountActiveVCSProviderUsers

Method CountActiveVCSProviderUsers

backend/store/vcs_provider_user.go:39–45  ·  view source on GitHub ↗

CountActiveVCSProviderUsers counts active VCS provider users in the workspace.

(ctx context.Context, workspace string, activeWindow time.Duration)

Source from the content-addressed store, hash-verified

37
38// CountActiveVCSProviderUsers counts active VCS provider users in the workspace.
39func (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.

Calls 2

GetDBMethod · 0.95
ScanMethod · 0.80