From fe3491e16d1199523208ad8c6f3953481e7506bc Mon Sep 17 00:00:00 2001 From: Mathis Maquenne <124215603+mathismqn@users.noreply.github.com> Date: Wed, 6 Aug 2025 18:18:17 +0200 Subject: [PATCH] chore(watcher): disable feature due to known DB concurrency issues --- cmd/root.go | 25 ++++++++++++++----------- cmd/watch.go | 6 +++++- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index a618f68..acf6d25 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -1,10 +1,6 @@ package cmd import ( - "fmt" - "os" - - "github.com/mathismqn/godeez/internal/watcher" "github.com/spf13/cobra" ) @@ -13,14 +9,21 @@ var RootCmd = &cobra.Command{ Short: "GoDeez is a tool to download music from Deezer", SilenceUsage: true, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { - homeDir, err := os.UserHomeDir() - if err != nil { - return fmt.Errorf("failed to get home directory: %w", err) - } + // TEMPORARILY DISABLED: + // Watcher autostart (EnsureAutostart) has been disabled due to + // concurrency issues with database access (e.g., when using `download`). + // To re-enable, uncomment the line below. - if err := watcher.EnsureAutostart(homeDir); err != nil { - fmt.Fprintf(os.Stderr, "Warning: failed to install autostart for watcher: %v\n", err) - } + /* + homeDir, err := os.UserHomeDir() + if err != nil { + return fmt.Errorf("failed to get home directory: %w", err) + } + + if err := watcher.EnsureAutostart(homeDir); err != nil { + fmt.Fprintf(os.Stderr, "Warning: failed to install autostart for watcher: %v\n", err) + } + */ return nil }, diff --git a/cmd/watch.go b/cmd/watch.go index b92be07..f136a48 100644 --- a/cmd/watch.go +++ b/cmd/watch.go @@ -9,6 +9,10 @@ var watchCmd = &cobra.Command{ Short: "Watch playlists and auto-download new tracks", } +// TEMPORARILY DISABLED: +// The `watch` command and all its subcommands are currently disabled +// due to known issues (e.g., database access conflicts with `download`). +// To re-enable, uncomment the line below. func init() { - RootCmd.AddCommand(watchCmd) + // RootCmd.AddCommand(watchCmd) }