switchman 3.0.15 → 3.0.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d009eac65601ef2687150f472d14824f5d55976102257a381a2b7da4e9859131
4
- data.tar.gz: 37f505b1911705b84053e6c2949f544e0975a1ee4ce99df1db33c53ce5c1df46
3
+ metadata.gz: 375c0ee6f7bf35265f46a5b5a2d5b77a60e461c84b6a7df48617e8ad6853087c
4
+ data.tar.gz: b64d5c4b02f258cb25e8f60ce2b328d9377ef1c744a3d488c1cae249d1a50266
5
5
  SHA512:
6
- metadata.gz: 05c8ac0cec905fd3922c2271fa2e41dd0ba64890b433cdee1a15ad1255a74827d96fa79bd7f569c51cdd01e92965adc2889e534e63eaa72fae200ece912970d8
7
- data.tar.gz: f363145f950678a22893653bc6bfd34230c2e650e68151ebdf65ce7174cc14c79fc1dcfb16a1da4f1f4d264f7eae3a16f8766a27696e4659b58ca924d0ce9513
6
+ metadata.gz: 286d7ed35829487f57f3e3af640861563aeea66338b78485974965b600f3cc2e3d2bd169c9a826158966466e26e8bde813067e4d904e253183b4a5dd33665e6b
7
+ data.tar.gz: b62ab284455df8934811480724c92ccb9ed057541e4a36026d8925725886dd1795ea2fd81c5c22a595f1cd10f3e2516468491135fd485db437f6d12c9eca76f4
@@ -182,7 +182,7 @@ module Switchman
182
182
  new_title = [short_parent_name, name].join(' ')
183
183
  Process.setproctitle(new_title)
184
184
  Switchman.config[:on_fork_proc]&.call
185
- with_each_shard(subscope, classes, exception: exception, &block)
185
+ with_each_shard(subscope, classes, exception: exception, &block).map { |result| Parallel::ResultWrapper.new(result) }
186
186
  rescue => e
187
187
  logger.error e.full_message
188
188
  Parallel::QuietExceptionWrapper.new(name, ::Parallel::ExceptionWrapper.new(e))
@@ -198,7 +198,7 @@ module Switchman
198
198
  cause: errors.first.exception
199
199
  end
200
200
 
201
- return ret
201
+ return ret.map(&:result)
202
202
  end
203
203
 
204
204
  classes ||= []
@@ -25,6 +25,31 @@ module Switchman
25
25
  end
26
26
  end
27
27
 
28
+ class UndumpableResult
29
+ attr_reader :name
30
+
31
+ def initialize(result)
32
+ @name = result.inspect
33
+ end
34
+
35
+ def inspect
36
+ "#<UndumpableResult:#{name}>"
37
+ end
38
+ end
39
+
40
+ class ResultWrapper
41
+ attr_reader :result
42
+
43
+ def initialize(result)
44
+ @result =
45
+ begin
46
+ Marshal.dump(result) && result
47
+ rescue
48
+ UndumpableResult.new(result)
49
+ end
50
+ end
51
+ end
52
+
28
53
  class PrefixingIO
29
54
  delegate_missing_to :@original_io
30
55
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Switchman
4
- VERSION = '3.0.15'
4
+ VERSION = '3.0.16'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: switchman
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.15
4
+ version: 3.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Cutrer
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-03-24 00:00:00.000000000 Z
13
+ date: 2022-03-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord