From 40c706326e1eafa5db552afc74e13acaf3d76761 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Sat, 3 Apr 2010 12:07:04 +0200 Subject: use new middleware, update conf --- app.psgi | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'app.psgi') diff --git a/app.psgi b/app.psgi index 96aefdc..ead7b5e 100644 --- a/app.psgi +++ b/app.psgi @@ -7,8 +7,7 @@ use File::Basename; use FeedDiscovery::Handler; use Tatsumaki::Application; use Plack::Builder; -use Plack::Middleware::APIRateLimit::Backend::Redis; - +use Redis; my $app = Tatsumaki::Application->new( [ '/' => 'FeedDiscovery::Handler' ], ); $app->template_path(dirname(__FILE__) . "/templates"); @@ -17,11 +16,11 @@ $app->static_path(dirname(__FILE__) . "/static"); builder { enable "Plack::Middleware::ConditionalGET"; enable "Plack::Middleware::ETag"; - enable "Plack::Middleware::APIRateLimit", - backend => Plack::Middleware::APIRateLimit::Backend::Redis->new( + enable "Plack::Middleware::Throttle::Hourly", + backend => Redis->new( server => '127.0.0.1:6379', ), - requests_per_hour => 100; + max => 10; $app; }; -- cgit 1.4.1