chore(watcher): disable feature due to known DB concurrency issues

This commit is contained in:
Mathis Maquenne
2025-08-06 18:18:17 +02:00
parent ef018b38ad
commit fe3491e16d
2 changed files with 19 additions and 12 deletions
+14 -11
View File
@@ -1,10 +1,6 @@
package cmd package cmd
import ( import (
"fmt"
"os"
"github.com/mathismqn/godeez/internal/watcher"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@@ -13,14 +9,21 @@ var RootCmd = &cobra.Command{
Short: "GoDeez is a tool to download music from Deezer", Short: "GoDeez is a tool to download music from Deezer",
SilenceUsage: true, SilenceUsage: true,
PersistentPreRunE: func(cmd *cobra.Command, args []string) error { PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
homeDir, err := os.UserHomeDir() // TEMPORARILY DISABLED:
if err != nil { // Watcher autostart (EnsureAutostart) has been disabled due to
return fmt.Errorf("failed to get home directory: %w", err) // 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 return nil
}, },
+5 -1
View File
@@ -9,6 +9,10 @@ var watchCmd = &cobra.Command{
Short: "Watch playlists and auto-download new tracks", 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() { func init() {
RootCmd.AddCommand(watchCmd) // RootCmd.AddCommand(watchCmd)
} }