From 27b35fce507e909f6f68bb3ded1c8d01bb15cdf0 Mon Sep 17 00:00:00 2001 From: Lotfi zaouche Date: Tue, 30 Jun 2020 10:30:24 +0000 Subject: [PATCH] add port number in cache file name to avoid conflicts --- blockchain/parity/ethpoller/mode/stats.pm | 1 + blockchain/parity/ethpoller/mode/tracking.pm | 3 ++- blockchain/parity/restapi/mode/eth.pm | 3 ++- blockchain/parity/restapi/mode/infos.pm | 3 ++- blockchain/parity/restapi/mode/parity.pm | 3 ++- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/blockchain/parity/ethpoller/mode/stats.pm b/blockchain/parity/ethpoller/mode/stats.pm index 2da5bce2b..0037b4d8e 100644 --- a/blockchain/parity/ethpoller/mode/stats.pm +++ b/blockchain/parity/ethpoller/mode/stats.pm @@ -154,6 +154,7 @@ sub manage_selection { my ($self, %options) = @_; $self->{cache_name} = "parity_ethpoller_" . $self->{mode} . '_' . (defined($self->{option_results}->{hostname}) ? $self->{option_results}->{hostname} : 'me') . '_' . + (defined($self->{option_results}->{port}) ? $self->{option_results}->{port} : 'default') . '_' . (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); my $result = $options{custom}->request_api(url_path => '/stats'); diff --git a/blockchain/parity/ethpoller/mode/tracking.pm b/blockchain/parity/ethpoller/mode/tracking.pm index 652467f40..4304fb1e7 100644 --- a/blockchain/parity/ethpoller/mode/tracking.pm +++ b/blockchain/parity/ethpoller/mode/tracking.pm @@ -223,7 +223,8 @@ sub manage_selection { my ($self, %options) = @_; $self->{cache_name} = "parity_ethpoller_" . $self->{mode} . '_' . (defined($self->{option_results}->{hostname}) ? $self->{option_results}->{hostname} : 'me') . '_' . - (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); + (defined($self->{option_results}->{port}) ? $self->{option_results}->{port} : 'default') . '_' . + (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); my $results = $options{custom}->request_api(url_path => '/tracking'); diff --git a/blockchain/parity/restapi/mode/eth.pm b/blockchain/parity/restapi/mode/eth.pm index aca9d82b9..2e858b088 100644 --- a/blockchain/parity/restapi/mode/eth.pm +++ b/blockchain/parity/restapi/mode/eth.pm @@ -158,7 +158,8 @@ sub manage_selection { my ($self, %options) = @_; $self->{cache_name} = "parity_restapi_" . $self->{mode} . '_' . (defined($self->{option_results}->{hostname}) ? $self->{option_results}->{hostname} : 'me') . '_' . - (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); + (defined($self->{option_results}->{port}) ? $self->{option_results}->{port} : 'default') . '_' . + (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); my $query_form_post = [ { method => 'eth_mining', params => [], id => "1", jsonrpc => "2.0" }, { method => 'eth_coinbase', params => [], id => "2", jsonrpc => "2.0" }, diff --git a/blockchain/parity/restapi/mode/infos.pm b/blockchain/parity/restapi/mode/infos.pm index 215f85550..0721d8c75 100644 --- a/blockchain/parity/restapi/mode/infos.pm +++ b/blockchain/parity/restapi/mode/infos.pm @@ -57,7 +57,8 @@ sub manage_selection { my ($self, %options) = @_; $self->{cache_name} = "parity_restapi_" . $self->{mode} . '_' . (defined($self->{option_results}->{hostname}) ? $self->{option_results}->{hostname} : 'me') . '_' . - (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); + (defined($self->{option_results}->{port}) ? $self->{option_results}->{port} : 'default') . '_' . + (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); my $query_form_post = [ { method => 'parity_versionInfo', params => [], id => "1", jsonrpc => "2.0" }, { method => 'parity_chain', params => [], id => "2", jsonrpc => "2.0" }, diff --git a/blockchain/parity/restapi/mode/parity.pm b/blockchain/parity/restapi/mode/parity.pm index f62eb82e0..a0e18d0c3 100644 --- a/blockchain/parity/restapi/mode/parity.pm +++ b/blockchain/parity/restapi/mode/parity.pm @@ -131,7 +131,8 @@ sub manage_selection { my ($self, %options) = @_; $self->{cache_name} = "parity_restapi_" . $self->{mode} . '_' . (defined($self->{option_results}->{hostname}) ? $self->{option_results}->{hostname} : 'me') . '_' . - (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); + (defined($self->{option_results}->{port}) ? $self->{option_results}->{port} : 'default') . '_' . + (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); my $query_form_post = [ { method => 'parity_versionInfo', params => [], id => "1", jsonrpc => "2.0" }, { method => 'parity_chain', params => [], id => "2", jsonrpc => "2.0" },