factorylabs-delayed_job 1.8.1 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/delayed_job.gemspec +6 -3
- data/lib/delayed/command.rb +11 -10
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.8.
|
1
|
+
1.8.2
|
data/delayed_job.gemspec
CHANGED
@@ -1,12 +1,15 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
|
1
4
|
# -*- encoding: utf-8 -*-
|
2
5
|
|
3
6
|
Gem::Specification.new do |s|
|
4
7
|
s.name = %q{delayed_job}
|
5
|
-
s.version = "1.8.
|
8
|
+
s.version = "1.8.2"
|
6
9
|
|
7
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
11
|
s.authors = ["Tobias L\303\274tke"]
|
9
|
-
s.date = %q{2009-08-
|
12
|
+
s.date = %q{2009-08-26}
|
10
13
|
s.description = %q{Delayed_job (or DJ) encapsulates the common pattern of asynchronously executing longer tasks in the background. It is a direct extraction from Shopify where the job table is responsible for a multitude of core tasks.}
|
11
14
|
s.email = %q{gabe.varela@factorylabs.com}
|
12
15
|
s.extra_rdoc_files = [
|
@@ -40,7 +43,7 @@ Gem::Specification.new do |s|
|
|
40
43
|
s.homepage = %q{http://github.com/factorylabs/delayed_job/tree/master}
|
41
44
|
s.rdoc_options = ["--main", "README.textile", "--inline-source", "--line-numbers"]
|
42
45
|
s.require_paths = ["lib"]
|
43
|
-
s.rubygems_version = %q{1.3.
|
46
|
+
s.rubygems_version = %q{1.3.5}
|
44
47
|
s.summary = %q{Database-backed asynchronous priority queue system -- Extracted from Shopify}
|
45
48
|
s.test_files = [
|
46
49
|
"spec/database.rb",
|
data/lib/delayed/command.rb
CHANGED
@@ -4,12 +4,12 @@ require 'optparse'
|
|
4
4
|
|
5
5
|
module Delayed
|
6
6
|
class Command
|
7
|
-
attr_accessor :worker_count, :root_path, :
|
7
|
+
attr_accessor :worker_count, :root_path, :environment
|
8
8
|
|
9
9
|
def initialize(args)
|
10
10
|
@options = {:quiet => true}
|
11
11
|
@worker_count = 1
|
12
|
-
@
|
12
|
+
@configuration = nil
|
13
13
|
@root_path = RAILS_ROOT if defined?(RAILS_ROOT)
|
14
14
|
|
15
15
|
opts = OptionParser.new do |opts|
|
@@ -19,15 +19,12 @@ module Delayed
|
|
19
19
|
puts opts
|
20
20
|
exit 1
|
21
21
|
end
|
22
|
-
opts.on('-
|
23
|
-
self.root_path = RACK_ROOT
|
24
|
-
self.is_rack = true
|
25
|
-
end
|
26
|
-
opts.on('-l', '--load-path=PATH', 'Specify a custom path (i.e. not rails or rack)') do |p|
|
22
|
+
opts.on('-l', '--load-path=PATH', 'Specify a custom path (i.e. not rails)') do |p|
|
27
23
|
self.root_path = p
|
28
24
|
end
|
29
25
|
opts.on('-e', '--environment=NAME', 'Specifies the environment to run this delayed jobs under (test/development/production).') do |e|
|
30
|
-
|
26
|
+
self.environment = e
|
27
|
+
ENV['RAILS_ENV'] = e
|
31
28
|
end
|
32
29
|
opts.on('--min-priority N', 'Minimum priority of jobs to run.') do |n|
|
33
30
|
@options[:min_priority] = n
|
@@ -41,7 +38,11 @@ module Delayed
|
|
41
38
|
end
|
42
39
|
@args = opts.parse!(args)
|
43
40
|
end
|
44
|
-
|
41
|
+
|
42
|
+
def configure(&block)
|
43
|
+
@configuration = block
|
44
|
+
end
|
45
|
+
|
45
46
|
def daemonize
|
46
47
|
worker_count.times do |worker_index|
|
47
48
|
process_name = worker_count == 1 ? "delayed_job" : "delayed_job.#{worker_index}"
|
@@ -55,7 +56,7 @@ module Delayed
|
|
55
56
|
def run(worker_name = nil)
|
56
57
|
Dir.chdir(root_path)
|
57
58
|
require File.join(root_path, 'config', 'environment') if ENV['RAILS_ENV']
|
58
|
-
|
59
|
+
self.instance_eval(&@configuration) if @configuration
|
59
60
|
# Replace the default logger
|
60
61
|
logger = Logger.new(File.join(root_path, 'log', 'delayed_job.log'))
|
61
62
|
logger.level = ActiveRecord::Base.logger.level
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: factorylabs-delayed_job
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Tobias L\xC3\xBCtke"
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-08-
|
12
|
+
date: 2009-08-26 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|