Sha256: afb830419fbd07e2ece2313952cff75669f4a6a1f2c2258a44041bcb22bda7b5

Contents?: true

Size: 534 Bytes

Versions: 17

Compression:

Stored size: 534 Bytes

Contents

# Do not require this until want to use DelayedJob

module Gorynich
  module Head
    class DelayedJob < ::Delayed::Plugin

      callbacks do |lifecycle|
        lifecycle.around(:execute) do |*_args, &block|
          Gorynich.with(Gorynich.instance.default) do |current|
            if ::Delayed::Worker.logger.respond_to?(:tagged)
              ::Delayed::Worker.logger.tagged(tenant: current.tenant) { block.call }
            else
              block.call
            end
          end
        end
      end

    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
gorynich-1.3.4.273062 lib/gorynich/head/delayed_job.rb
gorynich-1.3.3.231946 lib/gorynich/head/delayed_job.rb
gorynich-1.3.2.231715 lib/gorynich/head/delayed_job.rb
gorynich-1.3.1.213701 lib/gorynich/head/delayed_job.rb
gorynich-1.3.0.213297 lib/gorynich/head/delayed_job.rb
gorynich-1.2.3.198656 lib/gorynich/head/delayed_job.rb
gorynich-1.2.2.198643 lib/gorynich/head/delayed_job.rb
gorynich-1.2.1.184916 lib/gorynich/head/delayed_job.rb
gorynich-1.2.0.180668 lib/gorynich/head/delayed_job.rb
gorynich-1.1.1.148381 lib/gorynich/head/delayed_job.rb
gorynich-1.1.0.142168 lib/gorynich/head/delayed_job.rb
gorynich-1.1.0.142154 lib/gorynich/head/delayed_job.rb
gorynich-1.1.0.142147 lib/gorynich/head/delayed_job.rb
gorynich-1.1.0.142142 lib/gorynich/head/delayed_job.rb
gorynich-1.1.0.142139 lib/gorynich/head/delayed_job.rb
gorynich-1.1.0.142136 lib/gorynich/head/delayed_job.rb
gorynich-1.1.0.142046 lib/gorynich/head/delayed_job.rb