mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-16 12:08:04 +00:00
Add flag to control downlod limit in aptly mirror update. #62
This commit is contained in:
+10
-1
@@ -143,7 +143,16 @@ func (context *AptlyContext) Progress() aptly.Progress {
|
|||||||
// Downloader returns instance of current downloader
|
// Downloader returns instance of current downloader
|
||||||
func (context *AptlyContext) Downloader() aptly.Downloader {
|
func (context *AptlyContext) Downloader() aptly.Downloader {
|
||||||
if context.downloader == nil {
|
if context.downloader == nil {
|
||||||
context.downloader = http.NewDownloader(context.Config().DownloadConcurrency, context.Progress())
|
var downloadLimit int64
|
||||||
|
limitFlag := context.flags.Lookup("download-limit")
|
||||||
|
if limitFlag != nil {
|
||||||
|
downloadLimit = limitFlag.Value.Get().(int64)
|
||||||
|
}
|
||||||
|
if downloadLimit == 0 {
|
||||||
|
downloadLimit = context.Config().DownloadLimit
|
||||||
|
}
|
||||||
|
context.downloader = http.NewDownloader(context.Config().DownloadConcurrency,
|
||||||
|
downloadLimit*1024, context.Progress())
|
||||||
}
|
}
|
||||||
|
|
||||||
return context.downloader
|
return context.downloader
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ Example:
|
|||||||
|
|
||||||
cmd.Flag.Bool("ignore-checksums", false, "ignore checksum mismatches while downloading package files and metadata")
|
cmd.Flag.Bool("ignore-checksums", false, "ignore checksum mismatches while downloading package files and metadata")
|
||||||
cmd.Flag.Bool("ignore-signatures", false, "disable verification of Release file signatures")
|
cmd.Flag.Bool("ignore-signatures", false, "disable verification of Release file signatures")
|
||||||
|
cmd.Flag.Int64("download-limit", 0, "limit download speed (kbytes/sec)")
|
||||||
cmd.Flag.Var(&keyRingsFlag{}, "keyring", "gpg keyring to use when verifying Release file (could be specified multiple times)")
|
cmd.Flag.Var(&keyRingsFlag{}, "keyring", "gpg keyring to use when verifying Release file (could be specified multiple times)")
|
||||||
|
|
||||||
return cmd
|
return cmd
|
||||||
|
|||||||
@@ -268,6 +268,10 @@ $ aptly mirror update wheezy\-main
|
|||||||
Options:
|
Options:
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
|
\-\fBdownload\-limit\fR=0
|
||||||
|
limit download speed (kbytes/sec)
|
||||||
|
.
|
||||||
|
.TP
|
||||||
\-\fBignore\-checksums\fR=false
|
\-\fBignore\-checksums\fR=false
|
||||||
ignore checksum mismatches while downloading package files and metadata
|
ignore checksum mismatches while downloading package files and metadata
|
||||||
.
|
.
|
||||||
|
|||||||
Reference in New Issue
Block a user