more redis and resque stuff
This commit is contained in:
parent
6fe8e8004e
commit
fedeefef98
1
rails/map-mash/.gitignore
vendored
1
rails/map-mash/.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
log/*.log
|
log/*.log
|
||||||
tmp/*
|
tmp/*
|
||||||
db/*.sqlite3
|
db/*.sqlite3
|
||||||
|
config/redis.conf
|
||||||
|
@ -4,8 +4,8 @@ gem 'rails', '2.3.2'
|
|||||||
gem 'active_presenter', '1.2.1'
|
gem 'active_presenter', '1.2.1'
|
||||||
gem 'activesupport', '2.3.2'
|
gem 'activesupport', '2.3.2'
|
||||||
gem 'awesome_print', '0.2.1', :require => 'ap'
|
gem 'awesome_print', '0.2.1', :require => 'ap'
|
||||||
|
gem 'mc-settings'
|
||||||
gem 'mongrel', '1.1.5'
|
gem 'mongrel', '1.1.5'
|
||||||
gem 'mysql', '2.8.1'
|
|
||||||
gem 'nokogiri', '1.4.3.1'
|
gem 'nokogiri', '1.4.3.1'
|
||||||
gem 'rack', '1.2.1'
|
gem 'rack', '1.2.1'
|
||||||
gem 'rake', '0.8.7'
|
gem 'rake', '0.8.7'
|
||||||
@ -18,6 +18,7 @@ gem 'resque-loner', '1.0.1'
|
|||||||
gem 'resque-scheduler', '2.0.0.d'
|
gem 'resque-scheduler', '2.0.0.d'
|
||||||
gem 'rmagick', '2.13.1'
|
gem 'rmagick', '2.13.1'
|
||||||
gem 'ruby-debug', '0.10.3'
|
gem 'ruby-debug', '0.10.3'
|
||||||
|
gem 'sqlite3'
|
||||||
gem 'typhoeus', '0.2.4'
|
gem 'typhoeus', '0.2.4'
|
||||||
gem 'unicorn', '3.7.0'
|
gem 'unicorn', '3.7.0'
|
||||||
gem 'uuid', '2.3.3'
|
gem 'uuid', '2.3.3'
|
||||||
|
@ -53,6 +53,7 @@ GEM
|
|||||||
macaddr (1.5.0)
|
macaddr (1.5.0)
|
||||||
systemu (>= 2.4.0)
|
systemu (>= 2.4.0)
|
||||||
machinist (1.0.6)
|
machinist (1.0.6)
|
||||||
|
mc-settings (0.1.6)
|
||||||
method_source (0.7.1)
|
method_source (0.7.1)
|
||||||
mime-types (1.17.2)
|
mime-types (1.17.2)
|
||||||
mongrel (1.1.5)
|
mongrel (1.1.5)
|
||||||
@ -61,7 +62,6 @@ GEM
|
|||||||
fastthread (>= 1.0.1)
|
fastthread (>= 1.0.1)
|
||||||
gem_plugin (>= 0.2.3)
|
gem_plugin (>= 0.2.3)
|
||||||
multi_json (1.0.4)
|
multi_json (1.0.4)
|
||||||
mysql (2.8.1)
|
|
||||||
nokogiri (1.4.3.1)
|
nokogiri (1.4.3.1)
|
||||||
pry (0.8.3)
|
pry (0.8.3)
|
||||||
coderay (>= 0.9.7)
|
coderay (>= 0.9.7)
|
||||||
@ -133,6 +133,7 @@ GEM
|
|||||||
rack (~> 1.1)
|
rack (~> 1.1)
|
||||||
tilt (>= 1.2.2, < 2.0)
|
tilt (>= 1.2.2, < 2.0)
|
||||||
slop (2.4.2)
|
slop (2.4.2)
|
||||||
|
sqlite3 (1.3.5)
|
||||||
systemu (2.4.2)
|
systemu (2.4.2)
|
||||||
term-ansicolor (1.0.7)
|
term-ansicolor (1.0.7)
|
||||||
thor (0.14.6)
|
thor (0.14.6)
|
||||||
@ -168,8 +169,8 @@ DEPENDENCIES
|
|||||||
guard-livereload
|
guard-livereload
|
||||||
launchy (= 0.3.7)
|
launchy (= 0.3.7)
|
||||||
machinist (= 1.0.6)
|
machinist (= 1.0.6)
|
||||||
|
mc-settings
|
||||||
mongrel (= 1.1.5)
|
mongrel (= 1.1.5)
|
||||||
mysql (= 2.8.1)
|
|
||||||
nokogiri (= 1.4.3.1)
|
nokogiri (= 1.4.3.1)
|
||||||
pry
|
pry
|
||||||
rack (= 1.2.1)
|
rack (= 1.2.1)
|
||||||
@ -192,6 +193,7 @@ DEPENDENCIES
|
|||||||
ruby-debug-ide
|
ruby-debug-ide
|
||||||
ruby-prof (= 0.9.2)
|
ruby-prof (= 0.9.2)
|
||||||
sanitize
|
sanitize
|
||||||
|
sqlite3
|
||||||
typhoeus (= 0.2.4)
|
typhoeus (= 0.2.4)
|
||||||
unicorn (= 3.7.0)
|
unicorn (= 3.7.0)
|
||||||
uuid (= 2.3.3)
|
uuid (= 2.3.3)
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
rails_server: bundle exec script/server
|
rails_server: bundle exec script/server
|
||||||
resque_web: bundle exec resque-web --foreground --no-launch
|
resque_web: bundle exec script/resque-web-runner
|
||||||
redis: bundle exec redis-server config/redis.conf
|
redis: bundle exec script/redis-runner
|
||||||
|
6
rails/map-mash/config/initializers/01-settings.rb
Normal file
6
rails/map-mash/config/initializers/01-settings.rb
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
require 'mc-settings'
|
||||||
|
|
||||||
|
Setting.load(
|
||||||
|
:path => Rails.root,
|
||||||
|
:files => ['config/settings/default.yml']
|
||||||
|
)
|
8
rails/map-mash/config/initializers/redis_conf.rb
Normal file
8
rails/map-mash/config/initializers/redis_conf.rb
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
require 'erb'
|
||||||
|
|
||||||
|
File.open(Rails.root.join('config/redis.conf.erb'), 'r') do |f|
|
||||||
|
tmpl = ERB.new(f.read)
|
||||||
|
File.open(Rails.root.join('config/redis.conf'), 'w') do |conf|
|
||||||
|
conf.write(tmpl.result(binding))
|
||||||
|
end
|
||||||
|
end
|
@ -22,7 +22,7 @@ pidfile /tmp/rails-map-mash-redis/server.pid
|
|||||||
|
|
||||||
# Accept connections on the specified port, default is 6379.
|
# Accept connections on the specified port, default is 6379.
|
||||||
# If port 0 is specified Redis will not listen on a TCP socket.
|
# If port 0 is specified Redis will not listen on a TCP socket.
|
||||||
port 16379
|
port <%= Setting.redis(:port) %>
|
||||||
|
|
||||||
# If you want you can bind a single interface, if the bind option is not
|
# If you want you can bind a single interface, if the bind option is not
|
||||||
# specified all the interfaces will listen for incoming connections.
|
# specified all the interfaces will listen for incoming connections.
|
5
rails/map-mash/config/settings/default.yml
Normal file
5
rails/map-mash/config/settings/default.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
resque_web:
|
||||||
|
port: 15678
|
||||||
|
|
||||||
|
redis:
|
||||||
|
port: 16379
|
5
rails/map-mash/script/resque-web-runner
Executable file
5
rails/map-mash/script/resque-web-runner
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
exec ruby <<EORUBY
|
||||||
|
require File.expand_path('../../config/environment', '$0')
|
||||||
|
exec "resque-web --foreground --no-launch --port #{Setting.resque_web(:port)}"
|
||||||
|
EORUBY
|
Loading…
Reference in New Issue
Block a user