refactor(db): thread context.Context through all Store methods
Enables request-scoped cancellation, timeouts, and graceful shutdown for all database operations across API handlers, CLI commands, and TUI.
This commit is contained in:
+2
-2
@@ -17,7 +17,7 @@ var addCmd = &cobra.Command{
|
||||
RunE: runAdd,
|
||||
}
|
||||
|
||||
func runAdd(_ *cobra.Command, args []string) error {
|
||||
func runAdd(cmd *cobra.Command, args []string) error {
|
||||
input := strings.Join(args, " ")
|
||||
|
||||
parsed, err := parse.Parse(input)
|
||||
@@ -47,7 +47,7 @@ func runAdd(_ *cobra.Command, args []string) error {
|
||||
e.CardType = &ct
|
||||
}
|
||||
|
||||
if err := store.Create(e); err != nil {
|
||||
if err := store.Create(cmd.Context(), e); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user