Merge pull request #1184 from ZmagoD/zd_SCI_2417

adds asset_text_data to global search options
This commit is contained in:
Zmago Devetak 2018-06-08 14:30:52 +02:00 committed by GitHub
commit 74ccaf06b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View file

@ -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

View file

@ -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',