From 62ccdf97d4eececf5f274b6f14375a8e2b923156 Mon Sep 17 00:00:00 2001 From: albert Date: Wed, 20 Feb 2013 17:08:51 -0500 Subject: [PATCH] improved error message for posts --- app/controllers/posts_controller.rb | 1 + config/deploy.rb | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 65488a56b..0d3112163 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -4,6 +4,7 @@ class PostsController < ApplicationController respond_to :html, :xml, :json rescue_from PostSets::SearchError, :with => :search_error rescue_from Post::SearchError, :with => :search_error + rescue_from Danbooru::Paginator::PaginationError, :with => :search_error def index @post_set = PostSets::Post.new(tag_query, params[:page], params[:limit]) diff --git a/config/deploy.rb b/config/deploy.rb index 959bb32c8..71815c3e4 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -79,6 +79,18 @@ namespace :deploy do end end + namespace :nginx do + desc "Shut down Nginx" + task :stop do + sudo "for i in `pgrep -f nginx` ; do kill -SIGTERM $i ; done" + end + + desc "Start Nginx" + task :stop do + sudo "/etc/init.d/nginx start" + end + end + desc "Precompiles assets" task :precompile_assets do run "cd #{current_path}; bundle exec rake assets:precompile"