krasnoukhov/sidekiq-middleware — pull request #11 by thinkgareth (2013-06-05 23:06:54+00:00)
Title: Issue with client & server in the same application...

When running both client and server in the same app e.g.

```ruby
::Sidekiq.configure_server do |config|
config.options[:concurrency] = configuration[:concurrency] || 1
config.options[:namespace] = 'sidekiq_job'
config.poll_interval = 1
config.redis = $redis_write
end

::Sidekiq.configure_client do |config|
config.options[:concurrency] = configuration[:concurrency] || 1
config.options[:namespace] = 'sidekiq_job'
config.redis = $redis_write
end
```

The middleware is applied incorrectly, in my instance, when the server starts to process a job, the unique client middleware is called, thus failing on the first line `get_sidekiq_options`.

Removing the nested chain of middleware (see code) on the server declaration fixes my issue.