Chore: Remove context.TODO (#43458)
* Remove context.TODO() from services * Fix live test
This commit is contained in:
@@ -28,7 +28,7 @@ const (
|
||||
)
|
||||
|
||||
func ProvideService(cfg *setting.Cfg, sqlStore *sqlstore.SQLStore) (*RemoteCache, error) {
|
||||
client, err := createClient(context.Background(), cfg.RemoteCacheOptions, sqlStore)
|
||||
client, err := createClient(cfg.RemoteCacheOptions, sqlStore)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -95,7 +95,7 @@ func (ds *RemoteCache) Run(ctx context.Context) error {
|
||||
return ctx.Err()
|
||||
}
|
||||
|
||||
func createClient(ctx context.Context, opts *setting.RemoteCacheOptions, sqlstore *sqlstore.SQLStore) (CacheStorage, error) {
|
||||
func createClient(opts *setting.RemoteCacheOptions, sqlstore *sqlstore.SQLStore) (CacheStorage, error) {
|
||||
if opts.Name == redisCacheType {
|
||||
return newRedisStorage(opts)
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ func TestCachedBasedOnConfig(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestInvalidCacheTypeReturnsError(t *testing.T) {
|
||||
_, err := createClient(context.Background(), &setting.RemoteCacheOptions{Name: "invalid"}, nil)
|
||||
_, err := createClient(&setting.RemoteCacheOptions{Name: "invalid"}, nil)
|
||||
assert.Equal(t, err, ErrInvalidCacheType)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user