summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Command/traewelling.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2023-01-07 13:07:29 +0100
committerDaniel Friesel <derf@finalrewind.org>2023-01-07 13:07:29 +0100
commit628bd319d627e94b0349391c2abce44fb51cab84 (patch)
tree31639a1c0bb09fedd83adcb07d3974dd6d0b2378 /lib/Travelynx/Command/traewelling.pm
parent5c9adc471044bf30f128290668bf17b25d95c828 (diff)
work, traewelling: only push to influxdb in prod mode
Diffstat (limited to 'lib/Travelynx/Command/traewelling.pm')
-rw-r--r--lib/Travelynx/Command/traewelling.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/Travelynx/Command/traewelling.pm b/lib/Travelynx/Command/traewelling.pm
index 5967b28..d8eeaef 100644
--- a/lib/Travelynx/Command/traewelling.pm
+++ b/lib/Travelynx/Command/traewelling.pm
@@ -126,8 +126,15 @@ sub run {
if ( not $direction or $direction eq 'pull' ) {
$report .= ",pull_runtime_seconds=${trwl_pull_duration}";
}
- $self->app->ua->post_p( $self->app->config->{influxdb}->{url},
- "traewelling ${report}" )->wait;
+ if ( $self->app->mode eq 'development' ) {
+ $self->app->log->debug( 'POST '
+ . $self->app->config->{influxdb}->{url}
+ . " traewelling ${report}" );
+ }
+ else {
+ $self->app->ua->post_p( $self->app->config->{influxdb}->{url},
+ "traewelling ${report}" )->wait;
+ }
}
}