Skip Menu |

This queue is for tickets about the Catalyst-Controller-RateLimit CPAN distribution.

Report information
The Basics
Id: 76552
Status: resolved
Priority: 0/
Queue: Catalyst-Controller-RateLimit

People
Owner: Nobody in particular
Requestors: GHENRY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.28
Fixed in: (no value)



Subject: "Can't locate object method "cache" via package "RateLimit"
Hi, Caught exception in RateLimit::Controller::test->index "Can't locate object method "cache" via package "RateLimit" at /opt/local/lib/perl5/site_perl/5.12.4/Catalyst/Controller/RateLimit.pm line 88." I'm on the latest Catalyst version using: package RateLimit::Controller::test; use Moose; use namespace::autoclean; BEGIN { extends qw/ Catalyst::Controller::RateLimit / } # # Sets the actions in this controller to be registered with no prefix # so they function identically to actions created in MyApp.pm # __PACKAGE__->config( rate_limit_backend_name => 'Cache::Memcached::Fast', # ^- Optional. Only if your module is not Cache::Memcached::Fast # child, but has the same behavior. rate_limit => { default => [ { attempts => 30, period => 3600, }, { attempts => 5, period => 60, } ] } ); =head1 NAME RateLimit::Controller::Root - Root Controller for RateLimit =head1 DESCRIPTION [enter your description here] =head1 METHODS =head2 index The root page (/) =cut sub index : Path : Args(0) { my ( $self, $c ) = @_; if ( $self->flood_control->register_attempt( $c->user->login || $c->request->address ) ) { $c->response->body( $self->flood_control->get_attempt_count( 'default', $c->user->login || $c->request->address ) ); } }
Seems to be because you need to load a Catalyst cache plugin first so that there is a ->cache method. I'm using Catalyst::Plugin::Cache which is OK.
On Sun Apr 15 18:01:50 2012, GHENRY wrote: Show quoted text
> Seems to be because you need to load a Catalyst cache plugin first so > that there is a ->cache > method. > > I'm using Catalyst::Plugin::Cache which is OK.
Can you update the docs to state that or I'll send a patch. Thanks.