Skip to content

Commit

Permalink
fix: syntax error
Browse files Browse the repository at this point in the history
  • Loading branch information
scmmishra committed Nov 3, 2024
1 parent 2274f79 commit b337f0a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/jobs/send_post_batch_job.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class SendPostBatchJob < ApplicationJob
queue_as :default
# after_perform: :update_batch_count
after_perform :update_batch_count

UNSUBSCRIBE_PLACEHOLDER = "{{unsubscribe_link}}"

Expand All @@ -15,12 +15,12 @@ def perform(post_id, batch_subscribers)

private

# def update_batch_count
# post_id = @post.id
# remaining_batches = Rails.cache.decrement("post_#{post_id}_batches_remaining")
def update_batch_count
post_id = @post.id
remaining_batches = Rails.cache.decrement("post_#{post_id}_batches_remaining")

# @post.publish if remaining_batches <= 0
# end
@post.publish if remaining_batches <= 0
end

def send_batch(batch_subscribers)
Rails.logger.info "[PostMailer] Sending #{@post.title} to #{batch_subscribers.count} subscribers"
Expand Down

0 comments on commit b337f0a

Please sign in to comment.