fix: Decouple cloud sync from telemetry (#343)

This commit is contained in:
Abhisek Datta
2026-06-17 16:03:26 +05:30
committed by GitHub
parent baf637be97
commit 55f3f2a252
5 changed files with 10 additions and 31 deletions
-6
View File
@@ -8,7 +8,6 @@ import (
"github.com/safedep/dry/usefulerror"
"github.com/safedep/pmg/config"
"github.com/safedep/pmg/errcodes"
"github.com/safedep/pmg/internal/analytics"
"github.com/safedep/pmg/internal/audit"
"github.com/safedep/pmg/internal/ui"
"github.com/spf13/cobra"
@@ -37,11 +36,6 @@ func newSyncCommand() *cobra.Command {
func runSync(cmd *cobra.Command, args []string) error {
cfg := config.Get()
if analytics.IsDisabled() {
ui.Infof("Cloud sync is disabled because telemetry is disabled (disable_telemetry or PMG_DISABLE_TELEMETRY)")
return nil
}
if !cfg.Config.Cloud.Enabled {
ui.ErrorExit(usefulerror.NewUsefulError().
WithCode(errcodes.Lifecycle).
-6
View File
@@ -5,7 +5,6 @@ import (
"github.com/safedep/dry/log"
"github.com/safedep/pmg/config"
"github.com/safedep/pmg/internal/analytics"
"github.com/safedep/pmg/internal/audit"
"github.com/spf13/cobra"
)
@@ -30,11 +29,6 @@ func runSyncBackground(cmd *cobra.Command, args []string) error {
cfg := config.Get()
if analytics.IsDisabled() {
log.Debugf("Auto-sync: telemetry disabled; exiting")
return nil
}
if !cfg.Config.Cloud.Enabled || !cfg.Config.Cloud.AutoSync.Enabled {
log.Debugf("Auto-sync: cloud or auto_sync disabled; exiting")
return nil