From 58ada396ca9fe3b1e629e9962f0f85116e8abb1d Mon Sep 17 00:00:00 2001 From: fufu Date: Tue, 19 Aug 2025 03:31:45 +0300 Subject: [PATCH] adding back push updates internal flag --- v6/core/core.go | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/v6/core/core.go b/v6/core/core.go index c72fc88..71fe0b3 100644 --- a/v6/core/core.go +++ b/v6/core/core.go @@ -254,13 +254,19 @@ func (core *Core) wrapConfigurationFetchedHandler(handler model.ConfigurationFet } func (core *Core) startOrStopPushUpdatesListener() { - - if core.pushUpdatesListener == nil { - core.pushUpdatesListener = notifications.NewNotificationListener(core.environment.EnvironmentNotificationsPath(), core.sdkSettings.APIKey()) - core.pushUpdatesListener.On("changed", func(event notifications.Event) { - <-core.Fetch() - }) - core.pushUpdatesListener.Start() + if core.internalFlags.IsEnabled("rox.internal.pushUpdates") { + if core.pushUpdatesListener == nil { + core.pushUpdatesListener = notifications.NewNotificationListener(core.environment.EnvironmentNotificationsPath(), core.sdkSettings.APIKey()) + core.pushUpdatesListener.On("changed", func(event notifications.Event) { + <-core.Fetch() + }) + core.pushUpdatesListener.Start() + } + } else { + if core.pushUpdatesListener != nil { + core.pushUpdatesListener.Stop() + core.pushUpdatesListener = nil + } } }