mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
fix: Decouple cloud sync from telemetry (#343)
This commit is contained in:
@@ -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).
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user