Chore: Remove context.TODO() from services (#42555)
* Remove context.TODO() from services * Fix live test
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user