2020-07-14 14:46:03 +00:00
|
|
|
class CreateRoundRobin < ActiveRecord::Migration[5.0]
|
2019-08-14 09:48:44 +00:00
|
|
|
def change
|
|
|
|
InboxMember.find_each do |im|
|
2020-07-07 18:44:07 +00:00
|
|
|
round_robin_key = format(::Redis::Alfred::ROUND_ROBIN_AGENTS, inbox_id: im.inbox_id)
|
2019-08-14 09:48:44 +00:00
|
|
|
Redis::Alfred.lpush(round_robin_key, im.user_id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|