mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Zanzana: Add setting zanzana reconciliation interval (#96687)
Add config option under RBAC for zanzana reconciliation interval
This commit is contained in:
parent
0cb6c3d7bf
commit
e995d4f682
@ -98,9 +98,8 @@ func (r *ZanzanaReconciler) Reconcile(ctx context.Context) error {
|
||||
r.reconcile(ctx)
|
||||
|
||||
// FIXME:
|
||||
// 1. We should be a bit graceful about reconciliations so we are not hammering dbs
|
||||
// 2. We should be able to configure reconciliation interval
|
||||
ticker := time.NewTicker(1 * time.Hour)
|
||||
// We should be a bit graceful about reconciliations so we are not hammering dbs
|
||||
ticker := time.NewTicker(r.cfg.RBAC.ZanzanaReconciliationInterval)
|
||||
for {
|
||||
select {
|
||||
case <-ticker.C:
|
||||
|
@ -1,6 +1,9 @@
|
||||
package setting
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend/gtime"
|
||||
"github.com/grafana/grafana/pkg/util"
|
||||
)
|
||||
|
||||
@ -13,6 +16,9 @@ type RBACSettings struct {
|
||||
ResetBasicRoles bool
|
||||
// RBAC single organization. This configuration option is subject to change.
|
||||
SingleOrganization bool
|
||||
// If zanzana feature toggle is enabled this controls how often we
|
||||
// run the zanzana reconciliation loop.
|
||||
ZanzanaReconciliationInterval time.Duration
|
||||
|
||||
OnlyStoreAccessActionSets bool
|
||||
|
||||
@ -47,6 +53,12 @@ func (cfg *Cfg) readRBACSettings() {
|
||||
s.resourcesWithWildcardSeed[resource] = struct{}{}
|
||||
}
|
||||
|
||||
var err error
|
||||
s.ZanzanaReconciliationInterval, err = gtime.ParseDuration(rbac.Key("zanzana_reconciliation_interval").MustString("1h"))
|
||||
if err != nil {
|
||||
s.ZanzanaReconciliationInterval = 1 * time.Hour
|
||||
}
|
||||
|
||||
cfg.RBAC = s
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user