Skip to content

Commit 4314869

Browse files
committed
refactor: simplify optional key persistence
Use a single-line conditional modifier for the terminal history update. This satisfies both review and Standard Ruby. All 36 lookup tests pass. See #79
1 parent 32cba11 commit 4314869

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎lib/solid_objects/executor.rb‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,7 @@ def fail_message(error)
405405
if error.is_a?(NonRetryableError) ||
406406
locked_message.attempt_count >= locked_message.max_attempts
407407
create_dead_letter(message: locked_message, error_details:, now:)
408-
if locked_message.idempotency_key
409-
instance.update!(completed_idempotency_keys: remembered_keys(instance, locked_message))
410-
end
408+
instance.update!(completed_idempotency_keys: remembered_keys(instance, locked_message)) if locked_message.idempotency_key
411409
dead = true
412410
else
413411
ReadyMessage.create!(

0 commit comments

Comments
 (0)