Skip to content

Commit 447e130

Browse files
committed
Fix PuzzleInventoryCheckJob (check not just for approved puzzles, but approved and not yet sent)
1 parent f3f7a54 commit 447e130

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/jobs/puzzle_inventory_check_job.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ class PuzzleInventoryCheckJob < ApplicationJob
33
retry_on StandardError, attempts: 3
44

55
def perform
6-
approved_puzzle_count = Puzzle.where(state: 0).count
6+
approved_unsent_puzzle_count = Puzzle.where(state: 0, sent_at: nil).count
77

8-
if approved_puzzle_count < 5
9-
send_low_inventory_notification(approved_puzzle_count)
8+
if approved_unsent_puzzle_count < 5
9+
send_low_inventory_notification(approved_unsent_puzzle_count)
1010
end
1111
end
1212

0 commit comments

Comments
 (0)