Merge pull request #7352 from mitchellh/sethvargo/24

Bump box resume delay to 24h
This commit is contained in:
Seth Vargo 2016-05-27 16:05:27 -04:00
commit d9a4736e1c
2 changed files with 6 additions and 2 deletions

View File

@ -18,6 +18,10 @@ module Vagrant
# to NOT be metadata. # to NOT be metadata.
METADATA_SIZE_LIMIT = 20971520 METADATA_SIZE_LIMIT = 20971520
# This is the amount of time to "resume" downloads if a partial box
# file already exists.
RESUME_DELAY = 24 * 60 * 60
def initialize(app, env) def initialize(app, env)
@app = app @app = app
@logger = Log4r::Logger.new("vagrant::action::builtin::box_add") @logger = Log4r::Logger.new("vagrant::action::builtin::box_add")
@ -393,7 +397,7 @@ module Vagrant
if env[:box_clean] if env[:box_clean]
@logger.info("Cleaning existing temp box file.") @logger.info("Cleaning existing temp box file.")
delete = true delete = true
elsif temp_path.mtime.to_i < (Time.now.to_i - 6 * 60 * 60) elsif temp_path.mtime.to_i < (Time.now.to_i - RESUME_DELAY)
@logger.info("Existing temp file is too old. Removing.") @logger.info("Existing temp file is too old. Removing.")
delete = true delete = true
end end

View File

@ -43,7 +43,7 @@ variables are respected. HTTPS is also supported.
If an error occurs during the download or the download is interrupted with If an error occurs during the download or the download is interrupted with
a Ctrl-C, then Vagrant will attempt to resume the download the next time it a Ctrl-C, then Vagrant will attempt to resume the download the next time it
is requested. Vagrant will only attempt to resume a download for six hours is requested. Vagrant will only attempt to resume a download for 24 hours
after the initial download. after the initial download.
## Options ## Options