summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2022-12-30 19:49:17 +0100
committerDaniel Friesel <derf@finalrewind.org>2022-12-30 19:49:17 +0100
commitc5969fc1dcd0e1d47303ee0625994c2b27d9dd70 (patch)
tree8666da58eff3e6ae2c1a87ceb2a79e4893ef64b3
parentdc53e4774b2a5ddffa31d01d23879fa6f307c3b2 (diff)
work: count errors1.29.2
-rw-r--r--lib/Travelynx/Command/work.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Travelynx/Command/work.pm b/lib/Travelynx/Command/work.pm
index 786d678..05ebb16 100644
--- a/lib/Travelynx/Command/work.pm
+++ b/lib/Travelynx/Command/work.pm
@@ -29,6 +29,8 @@ sub run {
$self->app->log->debug("Removed ${num_incomplete} incomplete checkins");
}
+ my $errors = 0;
+
for my $entry ( $self->app->in_transit->get_all_active ) {
my $uid = $entry->{user_id};
@@ -98,6 +100,7 @@ sub run {
}
};
if ($@) {
+ $errors += 1;
$self->app->log->error("work($uid)/departure: $@");
}
@@ -170,6 +173,7 @@ sub run {
}
};
if ($@) {
+ $errors += 1;
$self->app->log->error("work($uid)/arrival: $@");
}
@@ -265,7 +269,7 @@ sub run {
if ( $self->app->config->{influxdb}->{url} ) {
$self->app->ua->post_p( $self->app->config->{influxdb}->{url},
-"worker main_seconds=${worker_duration},traewelling_push_seconds=${trwl_push_duration},traewelling_pull_seconds=${trwl_pull_duration},traewelling_seconds=${trwl_duration}"
+"worker main_seconds=${worker_duration},traewelling_push_seconds=${trwl_push_duration},traewelling_pull_seconds=${trwl_pull_duration},traewelling_seconds=${trwl_duration},errors=${errors}"
)->wait;
}
}