Skip to content

Commit

Permalink
Group worker.rb's accessor declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
bryckbost committed Apr 9, 2012
1 parent 0213df3 commit 977272a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/delayed/worker.rb
Expand Up @@ -16,7 +16,14 @@ class Worker
DEFAULT_QUEUES = []
DEFAULT_READ_AHEAD = 5

cattr_accessor :min_priority, :max_priority, :max_attempts, :max_run_time, :default_priority, :sleep_delay, :logger, :delay_jobs, :queues, :read_ahead
cattr_accessor :min_priority, :max_priority, :max_attempts, :max_run_time,
:default_priority, :sleep_delay, :logger, :delay_jobs, :queues,
:read_ahead, :plugins, :destroy_failed_jobs

cattr_reader :backend

# name_prefix is ignored if name is set directly
attr_accessor :name_prefix

def self.reset
self.sleep_delay = DEFAULT_SLEEP_DELAY
Expand All @@ -31,12 +38,10 @@ def self.reset
reset

# Add or remove plugins in this list before the worker is instantiated
cattr_accessor :plugins
self.plugins = [Delayed::Plugins::ClearLocks]

# By default failed jobs are destroyed after too many attempts. If you want to keep them around
# (perhaps to inspect the reason for the failure), set this to false.
cattr_accessor :destroy_failed_jobs
self.destroy_failed_jobs = true

self.logger = if defined?(Rails)
Expand All @@ -45,11 +50,6 @@ def self.reset
RAILS_DEFAULT_LOGGER
end

# name_prefix is ignored if name is set directly
attr_accessor :name_prefix

cattr_reader :backend

def self.backend=(backend)
if backend.is_a? Symbol
require "delayed/serialization/#{backend}"
Expand Down

0 comments on commit 977272a

Please sign in to comment.