File tree Expand file tree Collapse file tree 2 files changed +11
-18
lines changed Expand file tree Collapse file tree 2 files changed +11
-18
lines changed Original file line number Diff line number Diff line change @@ -19,31 +19,24 @@ To run the api web server, run the following on one of the servers:
1919
2020use Mojo::Base ' Mojolicious' ;
2121
22- use Config::ZOMG ();
23- use File::Temp ();
24- use List::Util qw( any ) ;
25- use MetaCPAN::Script::Runner ();
26- use Search::Elasticsearch ();
27- use Try::Tiny qw( catch try ) ;
22+ use File::Temp ();
23+ use List::Util qw( any ) ;
24+ use MetaCPAN::Script::Runner ();
25+ use Search::Elasticsearch ();
26+ use Try::Tiny qw( catch try ) ;
27+ use MetaCPAN::Server::Config ();
28+ use MooseX::Types::ElasticSearch qw( ES) ;
2829
2930has es => sub {
30- return Search::Elasticsearch-> new(
31- client => ' 2_0::Direct' ,
32- ( $ENV {ES } ? ( nodes => [ $ENV {ES } ] ) : () ),
33- );
31+ ES-> assert_coerce(
32+ MetaCPAN::Server::Config::config()-> {elasticsearch_servers } );
3433};
3534
3635sub startup {
3736 my $self = shift ;
3837
3938 unless ( $self -> config-> {config_override } ) {
40- $self -> config(
41- Config::ZOMG-> new(
42- local_suffix => $ENV {HARNESS_ACTIVE } ? ' testing' : ' local' ,
43- name => ' metacpan_server' ,
44- path => $self -> home-> to_string,
45- )-> load
46- );
39+ $self -> config( MetaCPAN::Server::Config::config() );
4740 }
4841
4942 die ' need secret' unless $self -> config-> {secret };
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ sub _build_config {
6666sub _build_es_client {
6767 my $self = shift ;
6868
69- my $es = ES-> coerce (
69+ my $es = ES-> assert_coerce (
7070 MetaCPAN::Server::Config::config()-> {elasticsearch_servers }, );
7171
7272 ok( $es , ' got Search::Elasticsearch object' );
You can’t perform that action at this time.
0 commit comments