mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 19:51:01 +08:00
21 lines
337 B
Ruby
21 lines
337 B
Ruby
|
AssetTextExtractionJob = Struct.new(:asset_id, :in_template) do
|
||
|
def perform
|
||
|
asset = Asset.find_by(id: asset_id)
|
||
|
return unless asset.present? && asset.file.attached?
|
||
|
|
||
|
asset.extract_asset_text(in_template)
|
||
|
end
|
||
|
|
||
|
def queue_name
|
||
|
'assets'
|
||
|
end
|
||
|
|
||
|
def max_attempts
|
||
|
1
|
||
|
end
|
||
|
|
||
|
def max_run_time
|
||
|
5.minutes
|
||
|
end
|
||
|
end
|