Delay initializing the s3 client until it's needed to silence warnings

Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
Shea Levy 2013-09-22 18:48:37 -04:00
parent 77dbf55abb
commit 98c9559bf2

View file

@ -14,7 +14,7 @@ use Nix::Store;
use Hydra::Model::DB;
use Hydra::Helper::CatalystUtils;
my $client = Net::Amazon::S3::Client->new( s3 => Net::Amazon::S3->new( retry => 1 ) );
my $client;
my %compressors = (
xz => "| $Nix::Config::xz",
bzip2 => "| $Nix::Config::bzip2",
@ -39,6 +39,9 @@ sub buildFinished {
}
return unless @matching_configs;
unless (defined $client) {
$client = Net::Amazon::S3::Client->new( s3 => Net::Amazon::S3->new( retry => 1 ) );
}
# !!! Maybe should do per-bucket locking?
my $lockhandle = IO::File->new;