Chore: Remove context.TODO() from services (#42555)

* Remove context.TODO() from services

* Fix live test
This commit is contained in:
idafurjes
2021-12-20 17:05:33 +01:00
committed by GitHub
parent 6f8e651cdb
commit ff3cf94b56
23 changed files with 78 additions and 75 deletions
+3 -2
View File
@@ -19,7 +19,7 @@ func ProvideCacheService(cacheService *localcache.CacheService, sqlStore *sqlsto
type CacheService interface {
GetDatasource(datasourceID int64, user *models.SignedInUser, skipCache bool) (*models.DataSource, error)
GetDatasourceByUID(datasourceUID string, user *models.SignedInUser, skipCache bool) (*models.DataSource, error)
GetDatasourceByUID(ctx context.Context, datasourceUID string, user *models.SignedInUser, skipCache bool) (*models.DataSource, error)
}
type CacheServiceImpl struct {
@@ -61,6 +61,7 @@ func (dc *CacheServiceImpl) GetDatasource(
}
func (dc *CacheServiceImpl) GetDatasourceByUID(
ctx context.Context,
datasourceUID string,
user *models.SignedInUser,
skipCache bool,
@@ -84,7 +85,7 @@ func (dc *CacheServiceImpl) GetDatasourceByUID(
plog.Debug("Querying for data source via SQL store", "uid", datasourceUID, "orgId", user.OrgId)
query := &models.GetDataSourceQuery{Uid: datasourceUID, OrgId: user.OrgId}
err := dc.SQLStore.GetDataSource(context.TODO(), query)
err := dc.SQLStore.GetDataSource(ctx, query)
if err != nil {
return nil, err
}