mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 21:42:37 +08:00
Chore: Add context to org (#40685)
* Add context to org * Rebase * Fix rebase
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user