lib/opener/stanza/tokenizer_pos.rb in opener-chained-daemon-3.0.6 vs lib/opener/stanza/tokenizer_pos.rb in opener-chained-daemon-3.0.7
- old
+ new
@@ -33,10 +33,11 @@
def run input, params
raise 'missing Stanza server' if ENV['STANZA_SERVER'].blank?
kaf = KAF::Document.from_xml input
- unless LANGUAGES_CACHE.get.include? kaf.language
+ prod = params[:cache_keys][:environment] != 'staging'
+ if prod and !LANGUAGES_CACHE.get.include?(kaf.language)
raise Core::UnsupportedLanguageError.new kaf.language
end
response = Faraday.post BASE_URL, {lang: kaf.language, input: kaf.raw}.to_query
raise Core::UnsupportedLanguageError, kaf.language if response.status == 406