прописываете URL для редиса- можно этот пункт поподробнее?
if ENV["REDISCLOUD_URL"]
$redis = Redis.new(:url => ENV["REDISCLOUD_URL"])
else
$redis = Redis.new(:host => 'localhost', :port => 6379)
end
require 'resque-scheduler'
uri = URI.parse("redis://localhost:6379/")
Resque.redis = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
class JobCreateEvents < Struct.new(:event_id, :user_id, :params)
def perform
user = User.find(user_id)
event = Event.find(event_id)
case event.repeat
when 1
for i in 1..365
next_event = user.events.create(params)
next_event.update_attributes( start_at: event.start_at + i.day )
next_event.update_attributes( end_at: event.end_at + i.day )
end
when 2
for i in 1..53
next_event = user.events.create(params)
next_event.update_attributes( start_at: event.start_at + i.week )
next_event.update_attributes( end_at: event.end_at + i.week )
end
when 3
for i in 1..11
next_event = user.events.create(params)
next_event.update_attributes( start_at: event.start_at + i.month )
next_event.update_attributes( end_at: event.end_at + i.month )
end
when 4
for i in 1..10
next_event = user.events.create(params)
next_event.update_attributes( start_at: event.start_at + i.year )
next_event.update_attributes( end_at: event.end_at + i.year )
end
end
end
end
def create
@event = current_user.events.create(event_params)
Delayed::Job.enqueue JobCreateEvents.new(@event.id, @current_user.id, event_params)
if @event.errors.empty?
redirect_to user_path(current_user)
else
render "new"
end
end
Есть у кого то опыт смешивания видео стримов в реальном времени? Есть ли более легкая альтернатива канвасу?