From 27de979733318262786d46ac7c7d242d4aa9f8d8 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Fri, 3 Oct 2014 11:02:31 +0400 Subject: [PATCH] More comments. #45 #114 --- cmd/mirror_update.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/mirror_update.go b/cmd/mirror_update.go index 7d6eaa86..5b5cc285 100644 --- a/cmd/mirror_update.go +++ b/cmd/mirror_update.go @@ -86,7 +86,7 @@ func aptlyMirrorUpdate(cmd *commander.Command, args []string) error { } defer func() { - // on any interreption, unlock the mirror + // on any interruption, unlock the mirror err := context.ReOpenDatabase() if err == nil { repo.MarkAsIdle() @@ -118,6 +118,7 @@ func aptlyMirrorUpdate(cmd *commander.Command, args []string) error { // Download all package files ch := make(chan error, count) + // In separate goroutine (to avoid blocking main), push queue to downloader go func() { for _, task := range queue { context.Downloader().DownloadWithChecksum(repo.PackageURL(task.RepoURI).String(), task.DestinationPath, ch, task.Checksums, ignoreMismatch)