Grafana indexing poc - load and watch index (#93843)
* list resources and load into index * watch for changes and update index
This commit is contained in:
@@ -32,6 +32,7 @@ func ProvideUnifiedStorageClient(
|
||||
DataPath: apiserverCfg.Key("storage_path").MustString(filepath.Join(cfg.DataPath, "grafana-apiserver")),
|
||||
Address: apiserverCfg.Key("address").MustString(""),
|
||||
}
|
||||
ctx := context.Background()
|
||||
|
||||
switch opts.StorageType {
|
||||
case options.StorageTypeFile:
|
||||
@@ -45,7 +46,7 @@ func ProvideUnifiedStorageClient(
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
backend, err := resource.NewCDKBackend(context.Background(), resource.CDKBackendOptions{
|
||||
backend, err := resource.NewCDKBackend(ctx, resource.CDKBackendOptions{
|
||||
Bucket: bucket,
|
||||
})
|
||||
if err != nil {
|
||||
@@ -76,7 +77,7 @@ func ProvideUnifiedStorageClient(
|
||||
|
||||
// Use the local SQL
|
||||
default:
|
||||
server, err := sql.NewResourceServer(db, cfg, features, tracer)
|
||||
server, err := sql.NewResourceServer(ctx, db, cfg, features, tracer)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user