mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-28 19:24:10 +08:00
Merge pull request #1184 from ZmagoD/zd_SCI_2417
adds asset_text_data to global search options
This commit is contained in:
commit
74ccaf06b9
2 changed files with 5 additions and 4 deletions
|
@ -199,7 +199,8 @@ class Asset < ApplicationRecord
|
|||
Rails.logger.info "Asset #{id}: Creating extract text job"
|
||||
# The extract_asset_text also includes
|
||||
# estimated size calculation
|
||||
delay(queue: :assets).extract_asset_text(team)
|
||||
delay(queue: :assets, run_at: 20.minutes.from_now)
|
||||
.extract_asset_text(team)
|
||||
else
|
||||
# Update asset's estimated size immediately
|
||||
update_estimated_size(team)
|
||||
|
@ -207,9 +208,7 @@ class Asset < ApplicationRecord
|
|||
end
|
||||
|
||||
def extract_asset_text(team = nil)
|
||||
if file.blank?
|
||||
return
|
||||
end
|
||||
return if file.blank?
|
||||
|
||||
begin
|
||||
file_path = file.path
|
||||
|
|
|
@ -176,6 +176,8 @@ class Constants
|
|||
#=============================================================================
|
||||
|
||||
TEXT_EXTRACT_FILE_TYPES = [
|
||||
'application/msword',
|
||||
'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
|
||||
'application/pdf',
|
||||
'application/rtf',
|
||||
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||
|
|
Loading…
Reference in a new issue