sucker_punch 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/lib/sucker_punch.rb +10 -10
- data/lib/sucker_punch/job.rb +1 -1
- data/lib/sucker_punch/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02222eadf72ce92d2552755c7bfb66332397c33e
|
4
|
+
data.tar.gz: d3d339c4ad293760b2dd6f4e3eb3675758fc3a2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eca020b9b49c2df52d474ba4d18b801c8f0723bda7a4a55bdecb23eb8fe886047b6765cf06939a8289a78a46471eebde8776b2a4caad96781013dc1ca589be8c
|
7
|
+
data.tar.gz: d05ec8872904d0d9720b6d150375ad42d5a4c06aad5d271f58fa782e3171e26a8c01868b6e816d779e2c762c8dbddc12ec8f674a026108537af67e591ba2157b
|
data/CHANGES.md
CHANGED
data/lib/sucker_punch.rb
CHANGED
@@ -10,12 +10,12 @@ module SuckerPunch
|
|
10
10
|
RUNNING = Concurrent::AtomicBoolean.new(true)
|
11
11
|
|
12
12
|
class << self
|
13
|
-
def exception_handler
|
14
|
-
@exception_handler
|
13
|
+
def exception_handler
|
14
|
+
@exception_handler ||= method(:default_exception_handler)
|
15
15
|
end
|
16
16
|
|
17
|
-
def exception_handler
|
18
|
-
@exception_handler
|
17
|
+
def exception_handler=(handler)
|
18
|
+
@exception_handler = handler
|
19
19
|
end
|
20
20
|
|
21
21
|
def default_exception_handler(ex, klass, args)
|
@@ -26,11 +26,7 @@ module SuckerPunch
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def logger
|
29
|
-
@logger
|
30
|
-
end
|
31
|
-
|
32
|
-
def logger=(log)
|
33
|
-
@logger = (log ? log : Logger.new('/dev/null'))
|
29
|
+
@logger ||= default_logger
|
34
30
|
end
|
35
31
|
|
36
32
|
def default_logger
|
@@ -39,9 +35,13 @@ module SuckerPunch
|
|
39
35
|
l
|
40
36
|
end
|
41
37
|
|
38
|
+
def logger=(log)
|
39
|
+
@logger = (log ? log : Logger.new('/dev/null'))
|
40
|
+
end
|
41
|
+
|
42
42
|
def shutdown_timeout
|
43
43
|
# 10 seconds on heroku, minus a grace period
|
44
|
-
@shutdown_timeout
|
44
|
+
@shutdown_timeout ||= 8
|
45
45
|
end
|
46
46
|
|
47
47
|
def shutdown_timeout=(timeout)
|
data/lib/sucker_punch/job.rb
CHANGED
@@ -33,7 +33,7 @@ module SuckerPunch
|
|
33
33
|
def perform_async(*args)
|
34
34
|
return unless SuckerPunch::RUNNING.true?
|
35
35
|
queue = SuckerPunch::Queue.find_or_create(self.to_s, num_workers)
|
36
|
-
queue.post(args) { |
|
36
|
+
queue.post(args) { |job_args| __run_perform(*job_args) }
|
37
37
|
end
|
38
38
|
|
39
39
|
def perform_in(interval, *args)
|
data/lib/sucker_punch/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sucker_punch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Hilkert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
version: '0'
|
121
121
|
requirements: []
|
122
122
|
rubyforge_project:
|
123
|
-
rubygems_version: 2.6.
|
123
|
+
rubygems_version: 2.6.13
|
124
124
|
signing_key:
|
125
125
|
specification_version: 4
|
126
126
|
summary: Sucker Punch is a Ruby asynchronous processing using concurrent-ruby, heavily
|