Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 9960ac9

Browse files
committed
address pr comments
1 parent 001b179 commit 9960ac9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/utils/pdf_to_images.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def extract_pages
7373

7474
@uploaded_pages = uploads
7575
ensure
76-
FileUtils.rm_rf(temp_dir)
76+
FileUtils.rm_rf(temp_dir) if temp_dir
7777
end
7878
end
7979
end

lib/utils/pdf_to_text.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# frozen_string_literal: true
22

33
class DiscourseAi::Utils::PdfToText
4+
MAX_PDF_SIZE = 100.megabytes
5+
46
class Reader
57
def initialize(upload:, user: nil, llm_model: nil)
68
@extractor =

0 commit comments

Comments
 (0)