mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-12 18:38:02 +08:00
Always use Tika text extractor in server mode [SCI-6658] (#3957)
This commit is contained in:
parent
ca53c3058a
commit
ac7a6edab5
1 changed files with 7 additions and 3 deletions
|
@ -296,9 +296,13 @@ class Asset < ApplicationRecord
|
|||
text_data = mjs_doc.search("//Field[@name='text']").collect(&:text).join(' ')
|
||||
else
|
||||
# Start Tika as a server
|
||||
Yomu.server(:text) if !ENV['NO_TIKA_SERVER'] && Yomu.class_variable_get(:@@server_pid).nil?
|
||||
blob.open do |tmp_file|
|
||||
text_data = Yomu.new(tmp_file.path).text
|
||||
Yomu.server(:text)
|
||||
begin
|
||||
blob.open do |tmp_file|
|
||||
text_data = Yomu.new(tmp_file.path).text
|
||||
end
|
||||
ensure
|
||||
Yomu.kill_server!
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue