X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=lib%2FMojoFacets.pm;h=ee69548300bf3e85ff203a3ca7b77b31f3124f3a;hb=ecb40a86de45079467b955bbbec8ea2baa67067e;hp=cfddc991aca6f65cd503c01cdb594ef7dfe18a5b;hpb=29afad5b3be03cf0111193d5fc60b97d0bfddb19;p=MojoFacets.git diff --git a/lib/MojoFacets.pm b/lib/MojoFacets.pm index cfddc99..ee69548 100644 --- a/lib/MojoFacets.pm +++ b/lib/MojoFacets.pm @@ -38,8 +38,6 @@ sub save_tx { } } -use MojoFacets::Plugin::NYTProf; - # This method will run once at server start sub startup { my $self = shift; @@ -59,8 +57,13 @@ sub startup { save_tx( $self, $tx ); } ); - - MojoFacets::Plugin::NYTProf->register( $self ); + + eval 'use MojoFacets::Plugin::NYTProf'; + if ( $@ ) { + warn "profile disabled: $@" if $@; + } else { + MojoFacets::Plugin::NYTProf->register( $self ); + } }