Chore: Refactor quota service (#57586)
* Chore: refactore quota service * Apply suggestions from code review
This commit is contained in:
committed by
GitHub
parent
faa0fda6eb
commit
326ea86a57
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/apikey"
|
||||
"github.com/grafana/grafana/pkg/services/apikey/apikeyimpl"
|
||||
"github.com/grafana/grafana/pkg/services/org"
|
||||
"github.com/grafana/grafana/pkg/services/quota/quotatest"
|
||||
"github.com/grafana/grafana/pkg/services/serviceaccounts"
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore"
|
||||
"github.com/grafana/grafana/pkg/services/user"
|
||||
@@ -70,8 +71,10 @@ func SetupApiKey(t *testing.T, sqlStore *sqlstore.SQLStore, testKey TestApiKey)
|
||||
addKeyCmd.Key = "secret"
|
||||
}
|
||||
|
||||
apiKeyService := apikeyimpl.ProvideService(sqlStore, sqlStore.Cfg)
|
||||
err := apiKeyService.AddAPIKey(context.Background(), addKeyCmd)
|
||||
quotaService := quotatest.New(false, nil)
|
||||
apiKeyService, err := apikeyimpl.ProvideService(sqlStore, sqlStore.Cfg, quotaService)
|
||||
require.NoError(t, err)
|
||||
err = apiKeyService.AddAPIKey(context.Background(), addKeyCmd)
|
||||
require.NoError(t, err)
|
||||
|
||||
if testKey.IsExpired {
|
||||
|
||||
Reference in New Issue
Block a user