bellbro 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bellbro/bell.rb +1 -1
- data/lib/bellbro/{notifier.rb → ringer.rb} +2 -2
- data/lib/bellbro/service.rb +6 -6
- data/lib/bellbro/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 120efff8ea0e78fb3d66c956710c992b334f7b2c
|
4
|
+
data.tar.gz: 4b60e315848cac0223753b75cdf272cea8faaa73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85942bd6428e156b6dc0491817a04a2a14f01d52c756679eefdea32595b399123c893f0e46b30cfb5ba2d7f91411ff83b1f1ffdbee91eaade4f1994503674caa
|
7
|
+
data.tar.gz: bbbac39c8e0006e740bd495c70d1147a07a37ee1a72b0263df63eccdf9d85d9a0c5b18bcf05934d9b3670e8edf41175b6512e7513d7f813353d73f339416b8c8
|
data/lib/bellbro/bell.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
module Bellbro
|
2
|
-
module
|
2
|
+
module Ringer
|
3
3
|
def self.included(klass)
|
4
4
|
klass.extend(self)
|
5
5
|
end
|
6
6
|
|
7
|
-
def
|
7
|
+
def ring(logline, opts={})
|
8
8
|
domain_insert = @domain ? "[#{@domain}]": ""
|
9
9
|
error_insert = (opts[:type] == :error) ? "##ERROR## " : ""
|
10
10
|
complete_logline = "[#{self.class}](#{Thread.current.object_id})#{domain_insert}: #{error_insert}#{logline}"
|
data/lib/bellbro/service.rb
CHANGED
@@ -20,8 +20,8 @@ module Bellbro
|
|
20
20
|
begin
|
21
21
|
run
|
22
22
|
rescue Exception => @thread_error
|
23
|
-
|
24
|
-
Airbrake.
|
23
|
+
ring "#{@thread_error.inspect}", type: :error
|
24
|
+
Airbrake.ring(@thread_error)
|
25
25
|
raise @thread_error
|
26
26
|
end
|
27
27
|
end
|
@@ -29,13 +29,13 @@ module Bellbro
|
|
29
29
|
|
30
30
|
def stop
|
31
31
|
@done = true
|
32
|
-
|
32
|
+
ring "Stopping #{self.class} service..."
|
33
33
|
@thread.join
|
34
|
-
|
34
|
+
ring "#{self.class.to_s.capitalize} service stopped."
|
35
35
|
end
|
36
36
|
|
37
37
|
def run
|
38
|
-
|
38
|
+
ring "Starting #{self.class} service."
|
39
39
|
Service.mutex.synchronize { track }
|
40
40
|
begin
|
41
41
|
start_jobs
|
@@ -49,7 +49,7 @@ module Bellbro
|
|
49
49
|
each_job do |job|
|
50
50
|
klass = job[:klass].constantize
|
51
51
|
jid = klass.perform_async(job[:arguments])
|
52
|
-
|
52
|
+
ring "Starting job #{jid} #{job[:klass]} with #{job[:arguments]}."
|
53
53
|
record_incr(:jobs_started)
|
54
54
|
end
|
55
55
|
end
|
data/lib/bellbro/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bellbro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Stokes
|
@@ -95,9 +95,9 @@ files:
|
|
95
95
|
- bellbro.gemspec
|
96
96
|
- lib/bellbro.rb
|
97
97
|
- lib/bellbro/bell.rb
|
98
|
-
- lib/bellbro/notifier.rb
|
99
98
|
- lib/bellbro/redis_pool.rb
|
100
99
|
- lib/bellbro/retryable.rb
|
100
|
+
- lib/bellbro/ringer.rb
|
101
101
|
- lib/bellbro/service.rb
|
102
102
|
- lib/bellbro/settings.rb
|
103
103
|
- lib/bellbro/sidekiq_utils.rb
|