make Redis a softer dependency
(closes foodcoops#288)
This commit is contained in:
parent
2a6e0e0460
commit
99301a0576
5 changed files with 17 additions and 10 deletions
|
@ -40,4 +40,7 @@ Foodsoft::Application.configure do
|
||||||
# Mailcatcher can be installed by gem install mailcatcher
|
# Mailcatcher can be installed by gem install mailcatcher
|
||||||
config.action_mailer.delivery_method = :smtp
|
config.action_mailer.delivery_method = :smtp
|
||||||
config.action_mailer.smtp_settings = { address: "localhost", port: 1025 }
|
config.action_mailer.smtp_settings = { address: "localhost", port: 1025 }
|
||||||
|
|
||||||
|
# Run resque tasks as part of the main app (not recommended for production)
|
||||||
|
Resque.inline = true
|
||||||
end
|
end
|
||||||
|
|
|
@ -36,4 +36,7 @@ Foodsoft::Application.configure do
|
||||||
|
|
||||||
# Print deprecation notices to the stderr.
|
# Print deprecation notices to the stderr.
|
||||||
config.active_support.deprecation = :stderr
|
config.active_support.deprecation = :stderr
|
||||||
|
|
||||||
|
# Run resque tasks as part of the main app
|
||||||
|
Resque.inline = true
|
||||||
end
|
end
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Resque.inline = Rails.env.test?
|
|
|
@ -21,14 +21,14 @@ Getting started
|
||||||
unfinished parts. If you want to be safe, choose the last release:
|
unfinished parts. If you want to be safe, choose the last release:
|
||||||
`git checkout $(git tag -l | grep ^v | sort -rn | head -n1)`
|
`git checkout $(git tag -l | grep ^v | sort -rn | head -n1)`
|
||||||
|
|
||||||
1. Install RVM and Ruby 2.0 (if you have not done so before):
|
1. Install RVM and Ruby 2 (if you have not done so before):
|
||||||
|
|
||||||
\curl -L https://get.rvm.io | bash
|
\curl -L https://get.rvm.io | bash
|
||||||
source ~/.rvm/scripts/rvm
|
source ~/.rvm/scripts/rvm
|
||||||
rvm install 2.0
|
rvm install 2.0
|
||||||
|
|
||||||
We try to keep foodsoft compatible with Ruby 1.9.3 as well as any later versions,
|
We try to keep foodsoft compatible with Ruby 1.9.3 as well as any later versions,
|
||||||
so if you have those and don't want to use RVM, that might actually work.
|
so if you use this and don't want to use RVM, that might actually work.
|
||||||
|
|
||||||
2. Install Ruby dependencies:
|
2. Install Ruby dependencies:
|
||||||
|
|
||||||
|
@ -122,15 +122,15 @@ explained here.
|
||||||
|
|
||||||
6. (optional) Get **background jobs** done
|
6. (optional) Get **background jobs** done
|
||||||
|
|
||||||
We use for time intensive tasks a background job queue, at the moment resque
|
Time intensive tasks may block the web request. To run these in a separate
|
||||||
with redis as key/value store. Install redis (in ubuntu the package
|
task, you can install Redis and enable Resque:
|
||||||
redis-server works out of the box) and start the resque worker with:
|
|
||||||
|
|
||||||
rake resque:work QUEUE=foodsoft_notifier
|
* Comment `Resque.inline = true` in `config/environments/development.rb`
|
||||||
|
* Install [Redis](http://redis.io/) (Ubuntu package `redis-server`)
|
||||||
|
* Run the worker: `rake resque:work QUEUE=foodsoft_notifier`
|
||||||
|
|
||||||
To have look on the current queue, failed jobs etc start the resque server with
|
To have look on the current queue, failed jobs etc start the resque server with
|
||||||
|
`resque-web`.
|
||||||
resque-web
|
|
||||||
|
|
||||||
|
|
||||||
7. (optional) **View mails in browser** instead in your logs
|
7. (optional) **View mails in browser** instead in your logs
|
||||||
|
|
|
@ -9,3 +9,5 @@ or mail some of us directly at
|
||||||
[developers@foodcoop.nl](mailto:developers@foodcoop.nl) or foodsoft (at)
|
[developers@foodcoop.nl](mailto:developers@foodcoop.nl) or foodsoft (at)
|
||||||
foodcoops.net.
|
foodcoops.net.
|
||||||
|
|
||||||
|
* [Passenger](https://www.phusionpassenger.com/) may be convenient.
|
||||||
|
* Redis is required for production by default.
|
||||||
|
|
Loading…
Reference in a new issue