Hook up the retryable tasks with hydra-notify

This commit is contained in:
Graham Christensen
2021-08-26 21:53:51 -04:00
parent c0e86faa78
commit ea3ae0693e
3 changed files with 11 additions and 2 deletions

View File

@ -6,6 +6,7 @@ use utf8;
use base 'DBIx::Class::ResultSet';
use List::Util qw(max);
use Hydra::Math qw(exponential_backoff);
use Hydra::Task;
=head2 get_seconds_to_next_retry

View File

@ -254,7 +254,7 @@ sub failure {
my $event_labels = $self->prom_labels_for_task($task);
if (defined($task->{"record"})) {
if ($task->{"record"}->{"attempts"} > 100) {
if ($task->{"record"}->attempts > 100) {
$self->{"prometheus"}->inc("notify_plugin_drop", $event_labels);
$task->{"record"}->delete();
} else {