Chore: Add context to org (#40685)

* Add context to org

* Rebase

* Fix rebase
This commit is contained in:
idafurjes
2021-11-03 11:31:56 +01:00
committed by GitHub
parent 91da1bbb79
commit 47f6bb3583
24 changed files with 120 additions and 112 deletions

View File

@ -1,6 +1,7 @@
package utils
import (
"context"
"errors"
"fmt"
@ -8,9 +9,9 @@ import (
"github.com/grafana/grafana/pkg/models"
)
func CheckOrgExists(orgID int64) error {
func CheckOrgExists(ctx context.Context, orgID int64) error {
query := models.GetOrgByIdQuery{Id: orgID}
if err := bus.Dispatch(&query); err != nil {
if err := bus.DispatchCtx(ctx, &query); err != nil {
if errors.Is(err, models.ErrOrgNotFound) {
return err
}