Skip to content

Commit b087c42

Browse files
committed
don't error (and therefore retry) if someone deletes a doc getting rev-saved
1 parent 3e0d221 commit b087c42

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/jobs/save_document_revision_job.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ class SaveDocumentRevisionJob < ApplicationJob
44
def perform(*args)
55
document_id = args.shift
66

7-
document = Document.find(document_id)
8-
return unless document.present?
7+
document = Document.find_by(id: document_id)
8+
return unless document
99

1010
# Update cached word count for the document regardless of how often this is called
1111
new_word_count = document.computed_word_count

0 commit comments

Comments
 (0)