Commit cee5e4c2 authored by Raphael's avatar Raphael

Bring in resque recipes and rake tasks

parent 8cb2a3a7
......@@ -7,5 +7,6 @@
require File.expand_path('../config/application', __FILE__)
require 'rake'
require 'resque/tasks'
Diaspora::Application.load_tasks
This diff is collapsed.
......@@ -18,3 +18,4 @@ include_recipe "centos::image_magick"
include_recipe "centos::mongo_db"
include_recipe "common::main"
include_recipe "centos::nginx"
include_recipe "centos::redis"
execute "refresh yum" do
command "yum update -y"
end
execute "install redis" do
command "yum install -y redis"
end
cookbook_file "/usr/local/etc/redis.conf" do
source "redis.conf"
end
execute "change redis.conf permissions" do
command "chmod 755 /usr/local/etc/redis.conf"
end
execute "make the redis db directory" do
command "mkdir -p /usr/local/var/db/redis"
end
......@@ -49,9 +49,24 @@ execute "executable" do
command "chmod -R 755 /service/magent"
end
execute "redis run" do
command "mkdir -p /service/redis && echo '#!/bin/sh' > /service/redis/run && echo 'cd /usr/sbin/ && exec /usr/sbin/redis-server /usr/local/etc/redis.conf' >> /service/redis/run"
end
execute "executable" do
command "chmod -R 755 /service/redis"
end
execute "nginx run" do
command "mkdir -p /service/nginx && echo '#!/bin/sh' > /service/nginx/run && echo 'exec /usr/local/nginx/sbin/nginx' >> /service/nginx/run"
end
execute "executable" do
command "chmod -R 755 /service/nginx"
end
execute "resque worker run" do
command "mkdir -p /service/resque_worker && echo '#!/bin/sh' > /service/resque_worker/run && echo 'cd /usr/local/app/diaspora && RAILS_ENV=production QUEUE=* exec /usr/local/bin/bundle exec /usr/local/bin/rake resque:work' >> /service/resque_worker/run"
end
execute "executable" do
command "chmod -R 755 /service/resque_worker"
end
Dir[File.join(Rails.root, 'app', 'jobs', '*.rb')].each { |file| require file }
config = YAML::load(File.open("#{Rails.root}/config/redis.yml"))
Resque.redis = Redis.new(:host => config['host'], :port => config['port'])
#config = YAML::load(File.open("#{Rails.root}/config/redis.yml"))
#Resque.redis = Redis.new(:host => config['host'], :port => config['port'])
require 'resque'
......@@ -82,5 +82,5 @@ fi
mkdir -p -v log/thin/
bundle exec ruby ./script/websocket_server.rb&
bundle exec magent start --log-path=log/ &
#bundle exec magent start --log-path=log/ &
bundle exec thin start $args
......@@ -15,22 +15,10 @@ describe User do
let(:user3) { make_user }
let(:aspect3) { user3.aspects.create(:name => 'heroes') }
before do
connect_users(user, aspect, user2, aspect2)
end
it 'should stream only one message to the everyone aspect when a multi-aspected contacts posts' do
user.add_person_to_aspect(user2.person.id, user.aspects.create(:name => "villains").id)
status = user2.post(:status_message, :message => "Users do things", :to => aspect2.id)
......@@ -61,7 +49,8 @@ describe User do
describe '#receive_salmon' do
it 'should handle the case where the webfinger fails' do
EMWebfinger.stub!(:fetch).and_return(nil)
pending "Write this to test #receive_salmon"
Webfinger.stub!(:fetch).and_return(nil)
proc{
user2.post :status_message, :message => "store this!", :to => aspect2.id
......
......@@ -39,6 +39,13 @@ RSpec.configure do |config|
end
end
module Resque
def enqueue(klass, *args)
true
end
end
ImageUploader.enable_processing = false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment