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

Method GetActivatedInstanceLimit

backend/enterprise/license.go:359–365  ·  view source on GitHub ↗

GetActivatedInstanceLimit returns the activated instance limit for the current subscription.

(ctx context.Context, workspaceID string)

Source from the content-addressed store, hash-verified

357
358// GetActivatedInstanceLimit returns the activated instance limit for the current subscription.
359func (s *LicenseService) GetActivatedInstanceLimit(ctx context.Context, workspaceID string) int {
360 limit := s.LoadSubscription(ctx, workspaceID).ActiveInstances
361 if limit < 0 {
362 return math.MaxInt
363 }
364 return int(limit)
365}
366
367func isUnifiedInstanceLimit(instanceLimit, activatedInstanceLimit int) bool {
368 return instanceLimit <= activatedInstanceLimit

Callers 2

checkActivationLimitMethod · 0.80

Calls 1

LoadSubscriptionMethod · 0.95

Tested by

no test coverage detected