Sha256: 38e44340f648b5b54e3f485294cddc8fe6c7c2c44cc386748e3d45a670bef288

Contents?: true

Size: 371 Bytes

Versions: 7

Compression:

Stored size: 371 Bytes

Contents

module Toro
  module Middleware
    module Server
      class Error
        def call(job, worker)
          begin
            yield
          rescue Exception => exception
            job.update_attributes(
              status: 'failed',
              finished_at: Time.now
            )
            raise exception
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
toro-0.2.2 lib/toro/middleware/server/error.rb
toro-0.2.1 lib/toro/middleware/server/error.rb
toro-0.2.0 lib/toro/middleware/server/error.rb
toro-0.1.1 lib/toro/middleware/server/error.rb
toro-0.1.0 lib/toro/middleware/server/error.rb
toro-0.0.3 lib/toro/middleware/server/error.rb
toro-0.0.2 lib/toro/middleware/server/error.rb