lib/delayed/worker.rb
# set up the session context information, so that it gets logged with the job log lines
# also set up a unique tmpdir, which will get removed at the end of the job.
set up the session context information, so that it gets logged with the job log lines
also set up a unique tmpdir, which will get removed at the end of the job.
set up the session context information so that it gets logged with the job log lines also set up a unique tmpdir which will get removed at the end of the job .
def configure_for_job(job)
      previous_tmpdir = ENV["TMPDIR"]
      self.class.running_job(job) do
        dir = Dir.mktmpdir("job-#{job.id}-#{name.gsub(/[^\w.]/, '.')}-")
        begin
          ENV["TMPDIR"] = dir
          yield
        ensure
          FileUtils.remove_entry(dir, true)
        end
      end
    ensure
      ENV["TMPDIR"] = previous_tmpdir
    end
def configure_for_job ( job ) previous_tmpdir = ENV [ "TMPDIR" ] self . class . running_job ( job ) do dir = Dir . mktmpdir ( "job-#{job.id}-#{name.gsub(/[^\w.]/, '.')}-" ) begin ENV [ "TMPDIR" ] = dir yield ensure FileUtils . remove_entry ( dir , true ) end end ensure ENV [ "TMPDIR" ] = previous_tmpdir end
set up the session context information, so that it gets logged with the job log lines
also set up a unique tmpdir, which will get removed at the end of the job.
set up the session context information so that it gets logged with the job log lines also set up a unique tmpdir which will get removed at the end of the job .
job