Sfoglia il codice sorgente

etcdctl: main routine of import command should wait for goroutine existing

Xiang Li 11 anni fa
parent
commit
1024f587e0
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  1. 1 0
      etcdctl/command/import_snap_command.go

+ 1 - 0
etcdctl/command/import_snap_command.go

@@ -80,6 +80,7 @@ func handleImportSnap(c *cli.Context) {
 	}
 	}
 	n := copyKeys(all.Node, setc)
 	n := copyKeys(all.Node, setc)
 	close(setc)
 	close(setc)
+	wg.Wait()
 	fmt.Printf("finished importing %d keys\n", n)
 	fmt.Printf("finished importing %d keys\n", n)
 }
 }