bar finish in wrong spot

This commit is contained in:
Zack Scholl 2018-07-10 13:59:44 -07:00
parent b8f647291a
commit 53e0585f21
1 changed files with 3 additions and 1 deletions

View File

@ -484,7 +484,6 @@ func (c *Croc) dialUp() (err error) {
log.Debugf("receiving file into %s", receiveFileName)
err = c.receiveFile(receiveFileName, i, connection)
}
c.bar.Finish()
errorChan <- err
}(channel, uuid, port, i, errorChan)
}
@ -499,6 +498,9 @@ func (c *Croc) dialUp() (err error) {
c.cs.channel.ws.WriteJSON(c.cs.channel)
}
}
// close bar
c.bar.Finish()
// measure transfer time
c.cs.Lock()
c.cs.channel.transferTime = time.Since(c.cs.channel.startTransfer)
c.cs.Unlock()