Merge pull request #1479 from okriuchykhin/ok_SCI_2967

Optionally disable Tika background mode through env variable [SCI-2967]
This commit is contained in:
Alex Kriuchykhin 2019-02-11 12:56:31 +01:00 committed by GitHub
commit 11e0ccc24a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -242,12 +242,12 @@ class Asset < ApplicationRecord
file_path = fa.path
end
unless Yomu.class_eval('@@server_pid')
Yomu.server(:text, nil)
sleep(5)
# Start Tika as a server
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?