table_sync 4.1.0 → 4.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/table_sync/receiving/handler.rb +17 -13
- data/lib/table_sync/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c2a571110c8f306d04bcfb7b796a511b0b78d951228d9d09f7e9c85b10f704a
|
4
|
+
data.tar.gz: e69f07af2fbfee19655edd291c78f4c22773aa602d1e5c06b1ccde4b1a6d1cfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f8e01507a1ad943aa26f08d667869d80c2154bd4c0effe8de25b3ca4698cd4b7af67a741fbb81875f7dbc3f45f082ca04abb43a41aa35d340e6409858f5503b
|
7
|
+
data.tar.gz: a931a4d842586f703730c96c90bae10b43cea362e17d45ca4c62d27185306e9fc7cdcf18ac6c209c0ecb38ff6f4dc3f38415c1487cad6eea2a3be095c8cede72
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## [4.1.1] - 2020-11-06
|
5
|
+
### Fixed
|
6
|
+
- dead locks in receiving module (see: `spec/receiving/handler_spec.rb#avoid dead locks`)
|
7
|
+
|
4
8
|
## [4.1.0] - 2020-11-02
|
5
9
|
### Changed
|
6
10
|
- move `TableSync::Instrument.notify` from models to the handler
|
data/Gemfile.lock
CHANGED
@@ -23,6 +23,8 @@ class TableSync::Receiving::Handler < Rabbit::EventHandler
|
|
23
23
|
|
24
24
|
validate_data(data, target_keys: target_keys)
|
25
25
|
|
26
|
+
data.sort_by! { |row| row.values_at(*target_keys) }
|
27
|
+
|
26
28
|
params = { data: data, target_keys: target_keys, version_key: version_key }
|
27
29
|
|
28
30
|
if event == :update
|
@@ -53,16 +55,20 @@ class TableSync::Receiving::Handler < Rabbit::EventHandler
|
|
53
55
|
end
|
54
56
|
|
55
57
|
def configs
|
56
|
-
@configs ||=
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
58
|
+
@configs ||= begin
|
59
|
+
configs = self.class.configs[model]
|
60
|
+
configs = configs.sort_by { |config| "#{config.model.schema}.#{config.model.table}" }
|
61
|
+
configs.map do |config|
|
62
|
+
::TableSync::Receiving::ConfigDecorator.new(
|
63
|
+
config: config,
|
64
|
+
# next parameters will be send to each proc-options from config
|
65
|
+
event: event,
|
66
|
+
model: model,
|
67
|
+
version: version,
|
68
|
+
project_id: project_id,
|
69
|
+
raw_data: data,
|
70
|
+
)
|
71
|
+
end
|
66
72
|
end
|
67
73
|
end
|
68
74
|
|
@@ -99,9 +105,7 @@ class TableSync::Receiving::Handler < Rabbit::EventHandler
|
|
99
105
|
end
|
100
106
|
|
101
107
|
if data.uniq { |row| row.slice(*target_keys) }.size != data.size
|
102
|
-
raise TableSync::DataError.new(
|
103
|
-
data, target_keys, "Duplicate rows found!"
|
104
|
-
)
|
108
|
+
raise TableSync::DataError.new(data, target_keys, "Duplicate rows found!")
|
105
109
|
end
|
106
110
|
end
|
107
111
|
|
data/lib/table_sync/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: table_sync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Umbrellio
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: memery
|