Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

success callback not triggered #92

Open
Eyoel-T opened this issue Aug 12, 2024 · 0 comments
Open

success callback not triggered #92

Eyoel-T opened this issue Aug 12, 2024 · 0 comments

Comments

@Eyoel-T
Copy link

Eyoel-T commented Aug 12, 2024

Versions
sidekiq (7.3.0)
sidekiq-batch (0.2.0)

class SimpleJob
  include Sidekiq::Job

  def perform(some_argument)
    logger.info "Performing SimpleJob with argument: #{some_argument}"
    # Simulate some work
    sleep 2
    logger.info "Completed SimpleJob with argument: #{some_argument}"
  end
end
class SomeFinalJob
  include Sidekiq::Job

  def perform(status, options)
    logger.info "All jobs in the batch have completed. Status: #{status}"
  end
end

rails console

batch = Sidekiq::Batch.new
batch.description = "Test batch for SimpleJob"
batch.on(:complete, SomeFinalJob, {})

batch.jobs do
  SimpleJob.perform_async("Test Argument 1")
  SimpleJob.perform_async("Test Argument 2")
end

puts "Batch created with ID #{batch.bid}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant