mirror of
https://github.com/grafana/grafana.git
synced 2025-09-25 23:14:10 +08:00
Alerting: Use the QuotaTargetSrv instead of the QuotaTarget in quota check (#60026)
Before this change, the alerting provisioning system incorrectly used the QuotaTarget to check if alerting's request quota had been reached. The quota service requires the QuotaTargetSrv, which is what's registered with the service at startup time. This is leading to errors in the provisioning system.
This commit is contained in:
@ -318,7 +318,7 @@ func (service *AlertRuleService) DeleteAlertRule(ctx context.Context, orgID int6
|
||||
|
||||
// checkLimitsTransactionCtx checks whether the current transaction (as identified by the ctx) breaches configured alert rule limits.
|
||||
func (service *AlertRuleService) checkLimitsTransactionCtx(ctx context.Context, orgID, userID int64) error {
|
||||
limitReached, err := service.quotas.CheckQuotaReached(ctx, "alert_rule", "a.ScopeParameters{
|
||||
limitReached, err := service.quotas.CheckQuotaReached(ctx, models.QuotaTargetSrv, "a.ScopeParameters{
|
||||
OrgID: orgID,
|
||||
UserID: userID,
|
||||
})
|
||||
|
Reference in New Issue
Block a user