Browse Source

Merge pull request #2613 from xiang90/fix_import

etcdctl: wait for goroutine existing
Xiang Li 10 years ago
parent
commit
a4fefd7f73
1 changed files with 1 additions and 0 deletions
  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)
 }
 }