diff options
author | Perl Tidy <perltidy@bugzilla.org> | 2018-12-05 21:38:52 +0100 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-12-05 23:49:08 +0100 |
commit | 8ec8da0491ad89604700b3e29a227966f6d84ba1 (patch) | |
tree | 9d270f173330ca19700e0ba9f2ee931300646de1 /Bugzilla/Elastic/Role | |
parent | a7bb5a65b71644d9efce5fed783ed545b9336548 (diff) | |
download | bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.gz bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.xz |
no bug - reformat all the code using the new perltidy rules
Diffstat (limited to 'Bugzilla/Elastic/Role')
-rw-r--r-- | Bugzilla/Elastic/Role/HasClient.pm | 12 | ||||
-rw-r--r-- | Bugzilla/Elastic/Role/Object.pm | 39 |
2 files changed, 25 insertions, 26 deletions
diff --git a/Bugzilla/Elastic/Role/HasClient.pm b/Bugzilla/Elastic/Role/HasClient.pm index a971392e0..41d8e7647 100644 --- a/Bugzilla/Elastic/Role/HasClient.pm +++ b/Bugzilla/Elastic/Role/HasClient.pm @@ -13,13 +13,13 @@ use Moo::Role; has 'client' => (is => 'lazy'); sub _build_client { - my ($self) = @_; + my ($self) = @_; - require Search::Elasticsearch; - return Search::Elasticsearch->new( - nodes => [ split(/\s+/, Bugzilla->params->{elasticsearch_nodes}) ], - cxn_pool => 'Sniff', - ); + require Search::Elasticsearch; + return Search::Elasticsearch->new( + nodes => [split(/\s+/, Bugzilla->params->{elasticsearch_nodes})], + cxn_pool => 'Sniff', + ); } 1; diff --git a/Bugzilla/Elastic/Role/Object.pm b/Bugzilla/Elastic/Role/Object.pm index 674545d04..6974d9087 100644 --- a/Bugzilla/Elastic/Role/Object.pm +++ b/Bugzilla/Elastic/Role/Object.pm @@ -12,45 +12,44 @@ use Role::Tiny; requires qw(ES_TYPE ES_INDEX ES_SETTINGS ES_PROPERTIES es_document); requires qw(ID_FIELD DB_TABLE); -sub ES_OBJECTS_AT_ONCE { 100 } +sub ES_OBJECTS_AT_ONCE {100} sub ES_SELECT_ALL_SQL { - my ($class, $last_id) = @_; + my ($class, $last_id) = @_; - my $id = $class->ID_FIELD; - my $table = $class->DB_TABLE; + my $id = $class->ID_FIELD; + my $table = $class->DB_TABLE; - return ("SELECT $id FROM $table WHERE $id > ? ORDER BY $id", [$last_id // 0]); + return ("SELECT $id FROM $table WHERE $id > ? ORDER BY $id", [$last_id // 0]); } requires qw(ES_SELECT_UPDATED_SQL); sub es_id { - my ($self) = @_; - return join('_', $self->ES_TYPE, $self->id); + my ($self) = @_; + return join('_', $self->ES_TYPE, $self->id); } around 'ES_PROPERTIES' => sub { - my $orig = shift; - my $self = shift; - my $properties = $orig->($self, @_); - $properties->{es_mtime} = { type => 'long' }; - $properties->{$self->ID_FIELD} = { type => 'long', analyzer => 'keyword' }; + my $orig = shift; + my $self = shift; + my $properties = $orig->($self, @_); + $properties->{es_mtime} = {type => 'long'}; + $properties->{$self->ID_FIELD} = {type => 'long', analyzer => 'keyword'}; - return $properties; + return $properties; }; around 'es_document' => sub { - my ($orig, $self, $mtime) = @_; - my $doc = $orig->($self); + my ($orig, $self, $mtime) = @_; + my $doc = $orig->($self); - $doc->{es_mtime} = $mtime; - $doc->{$self->ID_FIELD} = $self->id; - $doc->{_id} = $self->es_id; + $doc->{es_mtime} = $mtime; + $doc->{$self->ID_FIELD} = $self->id; + $doc->{_id} = $self->es_id; - return $doc; + return $doc; }; - 1; |