Chore: Remove context.TODO() (#43409)
* Remove context.TODO() from services * Fix live test * Remove context.TODO
This commit is contained in:
@@ -12,8 +12,8 @@ func (ss *SQLStore) addDashboardACLQueryAndCommandHandlers() {
|
||||
bus.AddHandlerCtx("sql", ss.GetDashboardAclInfoList)
|
||||
}
|
||||
|
||||
func (ss *SQLStore) UpdateDashboardACL(dashboardID int64, items []*models.DashboardAcl) error {
|
||||
return ss.UpdateDashboardACLCtx(context.TODO(), dashboardID, items)
|
||||
func (ss *SQLStore) UpdateDashboardACL(ctx context.Context, dashboardID int64, items []*models.DashboardAcl) error {
|
||||
return ss.UpdateDashboardACLCtx(ctx, dashboardID, items)
|
||||
}
|
||||
|
||||
func (ss *SQLStore) UpdateDashboardACLCtx(ctx context.Context, dashboardID int64, items []*models.DashboardAcl) error {
|
||||
|
||||
@@ -70,7 +70,7 @@ func TestDashboardAclDataAccess(t *testing.T) {
|
||||
|
||||
t.Run("Folder with removed default permissions returns no acl items", func(t *testing.T) {
|
||||
setup(t)
|
||||
err := sqlStore.UpdateDashboardACL(savedFolder.Id, nil)
|
||||
err := sqlStore.UpdateDashboardACL(context.Background(), savedFolder.Id, nil)
|
||||
require.Nil(t, err)
|
||||
|
||||
query := models.GetDashboardAclInfoListQuery{DashboardID: childDash.Id, OrgID: 1}
|
||||
|
||||
@@ -381,5 +381,5 @@ func testHelperUpdateDashboardAcl(t *testing.T, sqlStore *SQLStore, dashboardID
|
||||
item.Updated = time.Now()
|
||||
itemPtrs = append(itemPtrs, &item)
|
||||
}
|
||||
return sqlStore.UpdateDashboardACL(dashboardID, itemPtrs)
|
||||
return sqlStore.UpdateDashboardACL(context.Background(), dashboardID, itemPtrs)
|
||||
}
|
||||
|
||||
@@ -287,7 +287,7 @@ func createDummyACL(t *testing.T, sqlStore *SQLStore, dashboardPermission *Dashb
|
||||
acl.Role = &dashboardPermission.Role
|
||||
}
|
||||
|
||||
err := sqlStore.UpdateDashboardACL(dashboardID, []*models.DashboardAcl{acl})
|
||||
err := sqlStore.UpdateDashboardACL(context.Background(), dashboardID, []*models.DashboardAcl{acl})
|
||||
require.NoError(t, err)
|
||||
if user != nil {
|
||||
return user.Id
|
||||
|
||||
Reference in New Issue
Block a user