add geo info and do refractor on workers

This commit is contained in:
2021-04-29 20:44:21 +02:00
parent f7799bb514
commit c5190b48f8
32 changed files with 241 additions and 205 deletions

View File

@@ -1,25 +1,8 @@
# frozen_string_literal: true
class WowRealmDetailWorker
include Sidekiq::Worker
class WowRealmDetailWorker < WowSidekiqWorker
def perform(realm_id)
locales = [
['en-us', 'en_US'],
['es-mx', 'es_MX'],
['pt-br', 'pt_BR'],
['de-de', 'de_DE'],
['en-gb', 'en_GB'],
['es-es', 'es_ES'],
['fr-fr', 'fr_FR'],
['it', 'it_IT'],
['ru-ru', 'ru_RU'],
['ko', 'ko_KR'],
['zh-tw', 'zh_TW'],
['zh-cn', 'zh_CN']
]
return unless (realm = WowRealm.where(realm_id: realm_id).first)
return unless (realm = WowRealm.find_by(realm_id: realm_id))
RBattlenet.set_options(locale: 'all')
result = RBattlenet::Wow::Realm.find(realm_id)