E2C: Reduce UI poll interval and make configurable (#91386)

* E2C: Reduce UI poll interval and make configurable

* fix default
This commit is contained in:
Josh Hunt
2024-08-02 10:46:41 +01:00
committed by GitHub
parent a89435aeab
commit e55b438f14
7 changed files with 13 additions and 5 deletions
+3 -2
View File
@@ -257,8 +257,9 @@ type FrontendSettingsDTO struct {
PublicDashboardAccessToken string `json:"publicDashboardAccessToken"`
PublicDashboardsEnabled bool `json:"publicDashboardsEnabled"`
CloudMigrationIsTarget bool `json:"cloudMigrationIsTarget"`
CloudMigrationFeedbackURL string `json:"cloudMigrationFeedbackURL"`
CloudMigrationIsTarget bool `json:"cloudMigrationIsTarget"`
CloudMigrationFeedbackURL string `json:"cloudMigrationFeedbackURL"`
CloudMigrationPollIntervalMs int `json:"cloudMigrationPollIntervalMs"`
DateFormats setting.DateFormats `json:"dateFormats,omitempty"`
+1
View File
@@ -224,6 +224,7 @@ func (hs *HTTPServer) getFrontendSettings(c *contextmodel.ReqContext) (*dtos.Fro
PublicDashboardsEnabled: hs.Cfg.PublicDashboardsEnabled,
CloudMigrationIsTarget: isCloudMigrationTarget,
CloudMigrationFeedbackURL: hs.Cfg.CloudMigration.FeedbackURL,
CloudMigrationPollIntervalMs: int(hs.Cfg.CloudMigration.FrontendPollInterval.Milliseconds()),
SharedWithMeFolderUID: folder.SharedWithMeFolderUID,
RootFolderUID: accesscontrol.GeneralFolderUID,
LocalFileSystemAvailable: hs.Cfg.LocalFileSystemAvailable,
+2
View File
@@ -24,6 +24,7 @@ type CloudMigrationSettings struct {
DeleteTokenTimeout time.Duration
TokenExpiresAfter time.Duration
FeedbackURL string
FrontendPollInterval time.Duration
IsDeveloperMode bool
}
@@ -49,6 +50,7 @@ func (cfg *Cfg) readCloudMigrationSettings() {
cfg.CloudMigration.TokenExpiresAfter = cloudMigration.Key("token_expires_after").MustDuration(7 * 24 * time.Hour)
cfg.CloudMigration.IsDeveloperMode = cloudMigration.Key("developer_mode").MustBool(false)
cfg.CloudMigration.FeedbackURL = cloudMigration.Key("feedback_url").MustString("")
cfg.CloudMigration.FrontendPollInterval = cloudMigration.Key("frontend_poll_interval").MustDuration(2 * time.Second)
if cfg.CloudMigration.SnapshotFolder == "" {
cfg.CloudMigration.SnapshotFolder = filepath.Join(cfg.DataPath, "cloud_migration")