iachat/enterprise/app/jobs/response_bot/response_document_content_job.rb
Sojan Jose 41e269e873
feat(ee): Add reporting events for bots (#9027)
Added a new event conversation_bot_resolved and added a job to auto resolve the bot conversations if there was no activity for the last 1 hour.
2024-02-27 14:53:28 -08:00

11 lines
375 B
Ruby

# app/jobs/response_document_content_job.rb
class ResponseBot::ResponseDocumentContentJob < ApplicationJob
queue_as :default
def perform(response_document)
# Replace the selector with the actual one you need.
content = PageCrawlerService.new(response_document.document_link).body_text_content
response_document.update!(content: content[0..15_000])
end
end