diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Travelynx/Command/traewelling.pm | 11 | ||||
| -rw-r--r-- | lib/Travelynx/Command/work.pm | 14 | 
2 files changed, 20 insertions, 5 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; +		}  	}  } diff --git a/lib/Travelynx/Command/work.pm b/lib/Travelynx/Command/work.pm index 2cf3784..8af88bd 100644 --- a/lib/Travelynx/Command/work.pm +++ b/lib/Travelynx/Command/work.pm @@ -184,9 +184,17 @@ sub run {  	my $worker_duration  = $main_finished_at->epoch - $started_at->epoch;  	if ( $self->app->config->{influxdb}->{url} ) { -		$self->app->ua->post_p( $self->app->config->{influxdb}->{url}, -			"worker runtime_seconds=${worker_duration},errors=${errors}" ) -		  ->wait; +		if ( $self->app->mode eq 'development' ) { +			$self->app->log->debug( 'POST ' +				  . $self->app->config->{influxdb}->{url} +				  . " worker runtime_seconds=${worker_duration},errors=${errors}" +			); +		} +		else { +			$self->app->ua->post_p( $self->app->config->{influxdb}->{url}, +				"worker runtime_seconds=${worker_duration},errors=${errors}" ) +			  ->wait; +		}  	}  	if ( not $self->app->config->{traewelling}->{separate_worker} ) { | 
