mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-05 11:21:58 -05:00
Merge pull request #534 from liquidata-inc/aaron/clone-can-fail
go/cmd/dolt: commands/clone: In the case that Clone bailed early, we hung indefinitely.
This commit is contained in:
@@ -273,9 +273,9 @@ func cloneProg(eventCh <-chan datas.TableFileEvent) {
|
||||
}
|
||||
|
||||
func cloneRemote(ctx context.Context, srcDB *doltdb.DoltDB, remoteName, branch string, dEnv *env.DoltEnv) errhand.VerboseError {
|
||||
wg := &sync.WaitGroup{}
|
||||
eventCh := make(chan datas.TableFileEvent, 128)
|
||||
|
||||
wg := &sync.WaitGroup{}
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
@@ -283,6 +283,7 @@ func cloneRemote(ctx context.Context, srcDB *doltdb.DoltDB, remoteName, branch s
|
||||
}()
|
||||
|
||||
err := actions.Clone(ctx, srcDB, dEnv.DoltDB, eventCh)
|
||||
close(eventCh)
|
||||
|
||||
wg.Wait()
|
||||
|
||||
|
||||
@@ -106,10 +106,6 @@ func mapTableFiles(tblFiles []nbs.TableFile) ([]string, map[string]nbs.TableFile
|
||||
}
|
||||
|
||||
func clone(ctx context.Context, srcTS, sinkTS nbs.TableFileStore, eventCh chan<- TableFileEvent) error {
|
||||
if eventCh != nil {
|
||||
defer close(eventCh)
|
||||
}
|
||||
|
||||
root, tblFiles, err := srcTS.Sources(ctx)
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user