multiwoven-integrations 0.7.3 → 0.7.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37b545ee313b4f088f5978fc8332e12506b2c964919a4a1a6599c7549c968ba0
|
4
|
+
data.tar.gz: b8a089e677f9726a7ef2b432a6b6334a5e40e96b3190c216a133b6eef5cb6a09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e1563c35fdf1db6451ce8c53231a2b7aba4a1eaf050d264817e3c4d63be2c46c30691b7b08007c74af76a4d91b01bcd256b370f4c2fefe6e23e617adf8e1f85
|
7
|
+
data.tar.gz: 9fbe9e662993a134224d1ee03aff8ec6124ce7f59cc545b4beb3efba98407bfa42a19a846b4ebdb8d0c9a80ef4e9a58e82a4cc20219cc959a19ff3f16a98f926
|
@@ -57,11 +57,13 @@ module Multiwoven
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def process_records(records, stream)
|
60
|
+
log_message_array = []
|
60
61
|
write_success = 0
|
61
62
|
write_failure = 0
|
62
63
|
records.each do |record_object|
|
63
|
-
process_record(stream, record_object.with_indifferent_access)
|
64
|
+
request, response = *process_record(stream, record_object.with_indifferent_access)
|
64
65
|
write_success += 1
|
66
|
+
log_message_array << log_request_response("info", request, response)
|
65
67
|
rescue StandardError => e
|
66
68
|
write_failure += 1
|
67
69
|
handle_exception(e, {
|
@@ -70,8 +72,9 @@ module Multiwoven
|
|
70
72
|
sync_id: @sync_config.sync_id,
|
71
73
|
sync_run_id: @sync_config.sync_run_id
|
72
74
|
})
|
75
|
+
log_message_array << log_request_response("error", request, e.message)
|
73
76
|
end
|
74
|
-
tracking_message(write_success, write_failure)
|
77
|
+
tracking_message(write_success, write_failure, log_message_array)
|
75
78
|
end
|
76
79
|
|
77
80
|
def process_record(stream, record)
|
@@ -80,7 +83,8 @@ module Multiwoven
|
|
80
83
|
|
81
84
|
def send_data_to_slack(stream_name, record = {})
|
82
85
|
args = build_args(stream_name, record)
|
83
|
-
@client.send(stream_name, **args)
|
86
|
+
response = @client.send(stream_name, **args)
|
87
|
+
[args, response]
|
84
88
|
end
|
85
89
|
|
86
90
|
def build_args(stream_name, record)
|
@@ -114,12 +118,6 @@ module Multiwoven
|
|
114
118
|
def load_catalog
|
115
119
|
read_json(CATALOG_SPEC_PATH)
|
116
120
|
end
|
117
|
-
|
118
|
-
def tracking_message(success, failure)
|
119
|
-
Multiwoven::Integrations::Protocol::TrackingMessage.new(
|
120
|
-
success: success, failed: failure
|
121
|
-
).to_multiwoven_message
|
122
|
-
end
|
123
121
|
end
|
124
122
|
end
|
125
123
|
end
|