Chore: Refactor round robin logic (#1015)

Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
This commit is contained in:
Sojan Jose
2020-07-08 00:14:07 +05:30
committed by GitHub
parent 49db9c5d8a
commit 0fc0dc1683
18 changed files with 197 additions and 74 deletions

View File

@@ -16,9 +16,9 @@ module OnlineStatusTracker
def self.presence_key(account_id, type)
case type
when 'Contact'
Redis::Alfred::ONLINE_PRESENCE_CONTACTS % account_id
format(::Redis::Alfred::ONLINE_PRESENCE_CONTACTS, account_id: account_id)
else
Redis::Alfred::ONLINE_PRESENCE_USERS % account_id
format(::Redis::Alfred::ONLINE_PRESENCE_USERS, account_id: account_id)
end
end
@@ -34,7 +34,7 @@ module OnlineStatusTracker
end
def self.status_key(account_id)
Redis::Alfred::ONLINE_STATUS % account_id
format(::Redis::Alfred::ONLINE_STATUS, account_id: account_id)
end
def self.get_available_contacts(account_id)