Class: Vx::Worker::LogJob

Inherits:
Struct
  • Object
show all
Includes:
Helper::Logger
Defined in:
lib/vx/worker/middlewares/log_job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper::Logger

#logger

Instance Attribute Details

#appObject

Returns the value of attribute app

Returns:

  • (Object)

    the current value of app



4
5
6
# File 'lib/vx/worker/middlewares/log_job.rb', line 4

def app
  @app
end

Instance Method Details

#call(env) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/vx/worker/middlewares/log_job.rb', line 8

def call(env)
  logger.tagged("job #{env.job.message.id}.#{env.job.message.job_id}") do
    logger.info "starting job"
    rs = app.call env
    logger.info "done job"
    rs
  end
end