nodeup: fix logging of download times

We were capturing the time before waiting for the download.
This commit is contained in:
Justin SB 2022-12-03 16:26:52 -05:00
parent 0bc3015ce6
commit f03a1ece06
1 changed files with 3 additions and 1 deletions

View File

@ -117,7 +117,9 @@ func downloadURLAlways(url string, destPath string, dirMode os.FileMode) error {
}
start := time.Now()
defer klog.V(2).Infof("Copying %q to %q took %q", url, destPath, time.Since(start))
defer func() {
klog.V(2).Infof("Copying %q to %q took %q", url, destPath, time.Since(start))
}()
_, err = io.Copy(output, response.Body)
if err != nil {