diff options
-rw-r--r-- | lib/App/Glacier/Bre.pm | 4 | ||||
-rw-r--r-- | lib/App/Glacier/Command/Jobs.pm | 6 | ||||
-rw-r--r-- | lib/App/Glacier/Command/Periodic.pm | 23 |
3 files changed, 20 insertions, 13 deletions
diff --git a/lib/App/Glacier/Bre.pm b/lib/App/Glacier/Bre.pm index 3b1d190..cd9fb84 100644 --- a/lib/App/Glacier/Bre.pm +++ b/lib/App/Glacier/Bre.pm @@ -28,4 +28,4 @@ sub new { # FIXME: The attribute itself is not documented, so this - # this method may fail if the internals of the base class - # change in its future releases. + # method may fail if the internals of the base class change + # in its future releases. # This approach works with Net::Amazon::Glacier 0.15 diff --git a/lib/App/Glacier/Command/Jobs.pm b/lib/App/Glacier/Command/Jobs.pm index 736d713..5a5f488 100644 --- a/lib/App/Glacier/Command/Jobs.pm +++ b/lib/App/Glacier/Command/Jobs.pm @@ -8,2 +8,3 @@ use Data::Dumper; use App::Glacier::Timestamp; +use App::Glacier::Job; @@ -137,4 +138,5 @@ sub list { ($descr->{JobDescription} || $descr->{Action}) . - $descr->{JobId}); - $db->delete($key) unless $self->dry_run; + $descr->{JobId}); + App::Glacier::Job->fromdb($self, $vault, $key, $res)->delete() + unless $self->dry_run; return; diff --git a/lib/App/Glacier/Command/Periodic.pm b/lib/App/Glacier/Command/Periodic.pm index 51c9718..5a4dc2a 100644 --- a/lib/App/Glacier/Command/Periodic.pm +++ b/lib/App/Glacier/Command/Periodic.pm @@ -44,3 +44,3 @@ sub run { - return if $descr->{Completed}; + my $completed = $descr->{Completed}; @@ -48,5 +48,7 @@ sub run { if ($descr->{StatusCode} eq 'Failed') { - $self->debug(1, "deleting failed $key $vault " . - ($descr->{JobDescription} || $descr->{Action}) . - $descr->{JobId}); + $self->debug(1, + "deleting failed $key $vault " + . ($descr->{JobDescription} || $descr->{Action}) + . ' ' + . $descr->{JobId}); $db->delete($key) unless $self->dry_run; @@ -57,6 +59,9 @@ sub run { if ($self->glacier->lasterr('code') == 404) { - $self->debug(1, "deleting expired $key $vault " . - ($descr->{JobDescription} || $descr->{Action}) . - $descr->{JobId}); - $db->delete($key) unless $self->dry_run; + $self->debug(1, + "deleting expired $key $vault " + . ($descr->{JobDescription} || $descr->{Action}) + . ' ' + . $descr->{JobId}); + App::Glacier::Job->fromdb($self, $vault, $key, $res)->delete() + unless $self->dry_run; } else { @@ -67,3 +72,3 @@ sub run { croak "describe_job returned wrong datatype (".ref($res).") for \"$descr->{JobId}\""; - } else { + } elsif ($res->{Completed} ne $completed) { $self->debug(2, $res->{StatusCode}); |