Skip to content

Commit

Permalink
avoid 'Request has expired' on long lived Net::Amazon::EC2 objects
Browse files Browse the repository at this point in the history
  • Loading branch information
rluser committed Oct 23, 2011
1 parent 51ff2ee commit 8156574
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Net/Amazon/EC2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ has 'timestamp' => (
is => 'ro',
isa => 'Str',
required => 1,
lazy => 1,
clearer => '_clear_timestamp',
default => sub {
my $ts = time2isoz();
chop($ts);
Expand All @@ -184,6 +186,7 @@ sub _sign {
my %args = @_;
my $action = delete $args{Action};
my %sign_hash = %args;
$self->_clear_timestamp;
$sign_hash{AWSAccessKeyId} = $self->AWSAccessKeyId;
$sign_hash{Action} = $action;
$sign_hash{Timestamp} = $self->timestamp;
Expand Down

0 comments on commit 8156574

Please sign in to comment.