rabbit_jobs 0.1.8.2 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rabbit_jobs/configuration.rb +2 -3
- data/lib/rabbit_jobs/scheduler.rb +1 -0
- data/lib/rabbit_jobs/util.rb +21 -0
- data/lib/rabbit_jobs/version.rb +1 -1
- data/lib/rabbit_jobs/worker.rb +1 -0
- data/lib/rabbit_jobs.rb +1 -0
- metadata +13 -12
@@ -72,10 +72,9 @@ module RabbitJobs
|
|
72
72
|
@data[name]
|
73
73
|
end
|
74
74
|
|
75
|
-
def mail_errors_to(email = nil
|
76
|
-
if email
|
75
|
+
def mail_errors_to(email = nil)
|
76
|
+
if email
|
77
77
|
@data[:mail_errors_to] = email
|
78
|
-
@data[:mail_errors_from] = from_email
|
79
78
|
else
|
80
79
|
@data[:mail_errors_to]
|
81
80
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
|
3
|
+
module RabbitJobs::Util
|
4
|
+
# clean old worker process
|
5
|
+
def self.check_pidfile(pidfile)
|
6
|
+
if File.exists?(pidfile)
|
7
|
+
pid = File.read(pidfile).to_i
|
8
|
+
begin
|
9
|
+
Process.kill(0, pid)
|
10
|
+
RJ.logger.info "Killing old rabbit_jobs process ##{pid}"
|
11
|
+
Process.kill("TERM", pid)
|
12
|
+
|
13
|
+
while Process.kill(0, pid)
|
14
|
+
sleep(0.5)
|
15
|
+
end
|
16
|
+
rescue
|
17
|
+
File.delete(pidfile) if File.exists?(pidfile)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/rabbit_jobs/version.rb
CHANGED
data/lib/rabbit_jobs/worker.rb
CHANGED
data/lib/rabbit_jobs.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabbit_jobs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: amqp
|
16
|
-
requirement: &
|
16
|
+
requirement: &70247572694120 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0.9'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70247572694120
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: bunny
|
27
|
-
requirement: &
|
27
|
+
requirement: &70247572693100 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0.7'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70247572693100
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rake
|
38
|
-
requirement: &
|
38
|
+
requirement: &70247572691320 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70247572691320
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rufus-scheduler
|
49
|
-
requirement: &
|
49
|
+
requirement: &70247572689800 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '2.0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70247572689800
|
58
58
|
description: Background jobs on RabbitMQ
|
59
59
|
email:
|
60
60
|
- lazureykis@gmail.com
|
@@ -78,6 +78,7 @@ files:
|
|
78
78
|
- lib/rabbit_jobs/publisher.rb
|
79
79
|
- lib/rabbit_jobs/scheduler.rb
|
80
80
|
- lib/rabbit_jobs/tasks.rb
|
81
|
+
- lib/rabbit_jobs/util.rb
|
81
82
|
- lib/rabbit_jobs/version.rb
|
82
83
|
- lib/rabbit_jobs/worker.rb
|
83
84
|
- lib/tasks/rabbit_jobs.rake
|
@@ -108,7 +109,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
108
109
|
version: '0'
|
109
110
|
segments:
|
110
111
|
- 0
|
111
|
-
hash:
|
112
|
+
hash: -2922787991343531885
|
112
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
114
|
none: false
|
114
115
|
requirements:
|
@@ -117,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
118
|
version: '0'
|
118
119
|
segments:
|
119
120
|
- 0
|
120
|
-
hash:
|
121
|
+
hash: -2922787991343531885
|
121
122
|
requirements: []
|
122
123
|
rubyforge_project:
|
123
124
|
rubygems_version: 1.8.15
|