Optionally disable Tika background mode through env variable [SCI-2967]

This commit is contained in:
Oleksii Kriuchykhin 2019-02-04 16:47:29 +01:00
parent 688406cb2f
commit 13c4bd25af

View file

@ -242,12 +242,11 @@ class Asset < ApplicationRecord
file_path = fa.path
end
unless Yomu.class_eval('@@server_pid')
Yomu.server(:text, nil)
sleep(5)
if !ENV['NO_TIKA_SERVER'] && Yomu.class_variable_get(:@@server_pid).nil?
Yomu.server(:text)
end
y = Yomu.new file_path
y = Yomu.new file_path
text_data = y.text
if asset.asset_text_datum.present?