From 13c4bd25afcf26b8871bc4816f9c24f522379605 Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Mon, 4 Feb 2019 16:47:29 +0100 Subject: [PATCH] Optionally disable Tika background mode through env variable [SCI-2967] --- app/models/asset.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/models/asset.rb b/app/models/asset.rb index abfb9caa5..411796ffe 100644 --- a/app/models/asset.rb +++ b/app/models/asset.rb @@ -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?