mirror of
https://github.com/docusealco/docuseal
synced 2026-11-05 22:52:32 -05:00
process images async
This commit is contained in:
1 parent
2299ba4e29
commit
d090d79ebf
3 files changed
+28
-6
No files matched your search
@@ -0,0 +1,17 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ProcessDocumentJob
|
||||
include Sidekiq::Job
|
||||
|
||||
sidekiq_options queue: :images
|
||||
|
||||
def perform(params = {})
|
||||
attachment = ActiveStorage::Attachment.find(params['attachment_id'])
|
||||
|
||||
max_page = [attachment.metadata['pdf']['number_of_pages'].to_i - 1,
|
||||
Templates::ProcessDocument::MAX_NUMBER_OF_PAGES_PROCESSED].min
|
||||
|
||||
Templates::ProcessDocument.generate_document_preview_images(attachment, attachment.download, (1..max_page),
|
||||
concurrency: 1)
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user