Sha256: 70b7ccd860c8ab3eee0bc3baf6ad21180cf3d1960f8d45c1d0dbddba1e567662

Contents?: true

Size: 448 Bytes

Versions: 8

Compression:

Stored size: 448 Bytes

Contents

module Sidetiq
  class Middleware
    def initialize
      @clock = Sidetiq::Clock.instance
    end

    def call(*args)
      # Restart the clock if the thread died.
      if !@clock.ticking?
        Sidetiq.logger.warn "Sidetiq::Clock thread died. Restarting..."
        @clock.start!
      end
      yield
    end
  end
end

Sidekiq.configure_server do |config|
  config.server_middleware do |chain|
    chain.add Sidetiq::Middleware
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sidetiq-0.3.7 lib/sidetiq/middleware.rb
sidetiq-0.3.6 lib/sidetiq/middleware.rb
sidetiq-0.3.5 lib/sidetiq/middleware.rb
sidetiq-0.3.4 lib/sidetiq/middleware.rb
sidetiq-0.3.3 lib/sidetiq/middleware.rb
sidetiq-0.3.2 lib/sidetiq/middleware.rb
sidetiq-0.3.1 lib/sidetiq/middleware.rb
sidetiq-0.3.0 lib/sidetiq/middleware.rb