3e4bcc80c8
- Add Mozo::Counter::Redis with same get/set/incr/decr interface - Add redis gem (~> 5.0) to Gemfile - Update cable.yml to use Redis adapter in production (shared with counters) - Document DrbCounter → Redis migration in broadcasting-migration.md - Redis installed and running on vmi3300327 - Leave Faye as current broadcaster; both switches are one-line changes DrbCounter problems solved: - In-memory → persistent (RDB + AOF) - Single-process DRb → multi-process safe Redis - Atomic INCR/DECR across Puma workers - One less custom process to manage
20 lines
908 B
Ruby
20 lines
908 B
Ruby
if Rails.env.development?
|
|
Mozo.event_host = 'http://localhost:9296/faye'
|
|
Mozo.supplier_url = 'https://localhost:4202/supplier'
|
|
Mozo.user_url = 'https://localhost:4201'
|
|
else
|
|
Mozo.event_host = "https://events.mozo.bar/faye"
|
|
Mozo.supplier_url = "https://supplier.mozo.bar/supplier"
|
|
Mozo.user_url = 'https://user.mozo.bar'
|
|
end
|
|
|
|
# Broadcaster: swap Faye ↔ ActionCable
|
|
# Mozo.broadcaster = Mozo::Broadcaster::Faye.new # current (HTTP POST to Faye)
|
|
# Mozo.broadcaster = Mozo::Broadcaster::ActionCable.new # new (in-process async)
|
|
Mozo.broadcaster = Mozo::Broadcaster::Faye.new
|
|
|
|
# Counter: swap DrbCounter ↔ Redis
|
|
# Mozo::Counter.connection = Mozo::DrbCounter.object # current (DRb in-memory)
|
|
# Mozo::Counter.connection = Mozo::Counter::Redis.new # new (persistent, multi-process)
|
|
Mozo::Counter.connection = Mozo::DrbCounter.object unless Rails.env.test?
|