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

Middleware doesn't accept block of code #67

Open
przprz opened this issue Nov 22, 2023 · 0 comments
Open

Middleware doesn't accept block of code #67

przprz opened this issue Nov 22, 2023 · 0 comments

Comments

@przprz
Copy link
Contributor

przprz commented Nov 22, 2023

This code works:

class EventbossLoggerTags < Eventboss::Middleware::Base
  def call(work)
    queue_name = work.queue.name
    Rails.logger.tagged(queue_name) do
      yield
    end
  end
end

while this

class EventbossLoggerTags < Eventboss::Middleware::Base
  def call(work, &block)
    queue_name = work.queue.name
    Rails.logger.tagged(queue_name, &block)
  end
end

throws

Failure processing request: wrong number of arguments (given 1, expected 0)

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