@@ -176,9 +176,8 @@ func parseRuntimes(args []string) ([]common.Namespace, error) {
176176 return runtimes , nil
177177}
178178
179- func doMigrate (_ * cobra.Command , args []string ) error {
179+ func doMigrate (cmd * cobra.Command , args []string ) error {
180180 dataDir := cmdCommon .DataDir ()
181- ctx := context .Background ()
182181
183182 runtimes , err := parseRuntimes (args )
184183 cobra .CheckErr (err )
@@ -201,7 +200,7 @@ func doMigrate(_ *cobra.Command, args []string) error {
201200 }
202201
203202 helper := & migrateHelper {
204- ctx : ctx ,
203+ ctx : cmd . Context () ,
205204 history : history ,
206205 roots : map [hash.Hash ]node.RootType {},
207206 }
@@ -224,9 +223,8 @@ func doMigrate(_ *cobra.Command, args []string) error {
224223 return nil
225224}
226225
227- func doCheck (_ * cobra.Command , args []string ) error {
226+ func doCheck (cmd * cobra.Command , args []string ) error {
228227 dataDir := cmdCommon .DataDir ()
229- ctx := context .Background ()
230228
231229 runtimes , err := parseRuntimes (args )
232230 cobra .CheckErr (err )
@@ -245,7 +243,7 @@ func doCheck(_ *cobra.Command, args []string) error {
245243
246244 display := & displayHelper {}
247245
248- err := badger .CheckSanity (ctx , nodeCfg , display )
246+ err := badger .CheckSanity (cmd . Context () , nodeCfg , display )
249247 if err != nil {
250248 return fmt .Errorf ("node database checker returned error: %w" , err )
251249 }
0 commit comments