From 54078e114c00c4a5a1d2f867d673c9a97e79a94d Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Mon, 4 May 2015 15:20:40 +0800 Subject: [PATCH] =?UTF-8?q?redis=E7=BC=93=E5=AD=98=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E7=9A=84=E6=90=AD=E5=BB=BA=E4=BB=A5=E5=8F=8A=E5=AF=B9?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=9A=84=E7=BC=93=E5=AD=98=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=20Signed-off-by:=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 2 ++ app/controllers/welcome_controller.rb | 2 +- config/additional_environment.rb.example | 10 ---------- config/environments/development.rb | 6 +++--- config/initializers/redis.rb | 1 + db/schema.rb | 17 ----------------- 6 files changed, 7 insertions(+), 31 deletions(-) delete mode 100644 config/additional_environment.rb.example create mode 100644 config/initializers/redis.rb diff --git a/Gemfile b/Gemfile index 13b410d9d..d3fb6de22 100644 --- a/Gemfile +++ b/Gemfile @@ -23,6 +23,8 @@ gem "builder", "3.0.0" gem 'acts-as-taggable-on', '2.4.1' gem 'spreadsheet' gem 'ruby-ole' +gem 'redis' +gem 'redis-store' gem 'rails_kindeditor',path:'lib/rails_kindeditor' group :development do gem 'grape-swagger' diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index f35210f01..df006c9b4 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -19,7 +19,7 @@ class WelcomeController < ApplicationController include ApplicationHelper include WelcomeHelper helper :project_score - caches_action :robots + caches_action :robots, :course, :contest, :index, expires_in: 2.hours, layout: false #before_filter :find_first_page, :only => [:index] # before_filter :fake, :only => [:index, :course] before_filter :entry_select, :only => [:index] diff --git a/config/additional_environment.rb.example b/config/additional_environment.rb.example deleted file mode 100644 index 2a317a396..000000000 --- a/config/additional_environment.rb.example +++ /dev/null @@ -1,10 +0,0 @@ -# Copy this file to additional_environment.rb and add any statements -# that need to be passed to the Rails::Initializer. `config` is -# available in this context. -# -# Example: -# -# config.log_level = :debug -# ... -# - diff --git a/config/environments/development.rb b/config/environments/development.rb index d3843ff68..2aca152cb 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -10,9 +10,9 @@ RedmineApp::Application.configure do config.logger = Logger.new('log/development.log', 'daily') # daily, weekly or monthly # Show full error reports and disable caching config.consider_all_requests_local = true - config.action_controller.perform_caching = false - #config.cache_store = :file_store, "#{Rails.root }/files/cache_store/" - config.cache_store = :dalli_store + config.action_controller.perform_caching = true + config.cache_store = :file_store, "#{Rails.root }/files/cache_store/" + #config.cache_store = :dalli_store # Don't care if the mailer can't send config.action_mailer.raise_delivery_errors = true diff --git a/config/initializers/redis.rb b/config/initializers/redis.rb new file mode 100644 index 000000000..4aa95a27b --- /dev/null +++ b/config/initializers/redis.rb @@ -0,0 +1 @@ +$redis = Redis.new(:host => "127.0.0.1", :port => 6379) \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index 7fb01a8aa..95766c5c2 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -438,13 +438,6 @@ ActiveRecord::Schema.define(:version => 20150428021035) do add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" - create_table "discuss_demos", :force => true do |t| - t.string "title" - t.text "body" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - create_table "documents", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.integer "category_id", :default => 0, :null => false @@ -654,16 +647,6 @@ ActiveRecord::Schema.define(:version => 20150428021035) do add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" - create_table "journal_details_copy", :force => true do |t| - t.integer "journal_id", :default => 0, :null => false - t.string "property", :limit => 30, :default => "", :null => false - t.string "prop_key", :limit => 30, :default => "", :null => false - t.text "old_value" - t.text "value" - end - - add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id" - create_table "journal_replies", :id => false, :force => true do |t| t.integer "journal_id" t.integer "user_id"