make Redis a softer dependency

(closes foodcoops#288)
This commit is contained in:
wvengen 2014-05-31 14:20:45 +02:00
parent 2a6e0e0460
commit 99301a0576
5 changed files with 17 additions and 10 deletions

View File

@ -40,4 +40,7 @@ Foodsoft::Application.configure do
# Mailcatcher can be installed by gem install mailcatcher
config.action_mailer.delivery_method = :smtp
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

View File

@ -36,4 +36,7 @@ Foodsoft::Application.configure do
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
# Run resque tasks as part of the main app
Resque.inline = true
end

View File

@ -1 +0,0 @@
Resque.inline = Rails.env.test?

View File

@ -21,14 +21,14 @@ Getting started
unfinished parts. If you want to be safe, choose the last release:
`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
source ~/.rvm/scripts/rvm
rvm install 2.0
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:
@ -122,15 +122,15 @@ explained here.
6. (optional) Get **background jobs** done
We use for time intensive tasks a background job queue, at the moment resque
with redis as key/value store. Install redis (in ubuntu the package
redis-server works out of the box) and start the resque worker with:
Time intensive tasks may block the web request. To run these in a separate
task, you can install Redis and enable Resque:
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
resque-web
`resque-web`.
7. (optional) **View mails in browser** instead in your logs

View File

@ -9,3 +9,5 @@ or mail some of us directly at
[developers@foodcoop.nl](mailto:developers@foodcoop.nl) or foodsoft (at)
foodcoops.net.
* [Passenger](https://www.phusionpassenger.com/) may be convenient.
* Redis is required for production by default.