multiwoven-integrations 0.7.7 → 0.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 055227f9ec70d01b066063ca9d806514eb0cad47344a60e303b7a5bef9d0056d
|
4
|
+
data.tar.gz: 54317d770824c8870ccb58f7b2f852731b8df591cf53fc22ebe80d1b4b1a886e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4dea4975ecc8802be486334961579e680aab99a08ce96a330c4cd6aa14925c1d79e8140bffce057ff3dec8bcc1440f4eca1305dcf389694ea984d2e84fb2de8
|
7
|
+
data.tar.gz: eb235f292d326f59c8d9b35e11076eb32baaaa3b02c40a3cf7db570b50eba15159e12c97b8ff65f1f24bfd5f9b47fadf2f67762c305f5b379a0e8dc97759d918
|
@@ -45,10 +45,12 @@ module Multiwoven
|
|
45
45
|
connection_config = sync_config.destination.connection_specification.with_indifferent_access
|
46
46
|
url = connection_config[:destination_url]
|
47
47
|
headers = connection_config[:headers]
|
48
|
+
log_message_array = []
|
48
49
|
write_success = 0
|
49
50
|
write_failure = 0
|
50
51
|
records.each_slice(MAX_CHUNK_SIZE) do |chunk|
|
51
52
|
payload = create_payload(chunk)
|
53
|
+
args = [sync_config.stream.request_method, url, payload]
|
52
54
|
response = Multiwoven::Integrations::Core::HttpClient.request(
|
53
55
|
url,
|
54
56
|
sync_config.stream.request_method,
|
@@ -60,6 +62,7 @@ module Multiwoven
|
|
60
62
|
else
|
61
63
|
write_failure += chunk.size
|
62
64
|
end
|
65
|
+
log_message_array << log_request_response("info", args, response)
|
63
66
|
rescue StandardError => e
|
64
67
|
handle_exception(e, {
|
65
68
|
context: "HTTP:RECORD:WRITE:EXCEPTION",
|
@@ -68,13 +71,9 @@ module Multiwoven
|
|
68
71
|
sync_run_id: sync_config.sync_run_id
|
69
72
|
})
|
70
73
|
write_failure += chunk.size
|
74
|
+
log_message_array << log_request_response("error", args, e.message)
|
71
75
|
end
|
72
|
-
|
73
|
-
tracker = Multiwoven::Integrations::Protocol::TrackingMessage.new(
|
74
|
-
success: write_success,
|
75
|
-
failed: write_failure
|
76
|
-
)
|
77
|
-
tracker.to_multiwoven_message
|
76
|
+
tracking_message(write_success, write_failure, log_message_array)
|
78
77
|
rescue StandardError => e
|
79
78
|
handle_exception(e, {
|
80
79
|
context: "HTTP:RECORD:WRITE:EXCEPTION",
|
@@ -38,6 +38,7 @@ module Multiwoven::Integrations::Destination
|
|
38
38
|
|
39
39
|
request_method = sync_config.stream.request_method
|
40
40
|
|
41
|
+
log_message_array = []
|
41
42
|
write_success = 0
|
42
43
|
write_failure = 0
|
43
44
|
records.each do |record|
|
@@ -45,6 +46,7 @@ module Multiwoven::Integrations::Destination
|
|
45
46
|
# Add hardcode values into payload
|
46
47
|
record["data"] ||= {}
|
47
48
|
record["data"]["type"] = sync_config.stream.name
|
49
|
+
args = [request_method, url, record]
|
48
50
|
|
49
51
|
response = Multiwoven::Integrations::Core::HttpClient.request(
|
50
52
|
url,
|
@@ -57,6 +59,7 @@ module Multiwoven::Integrations::Destination
|
|
57
59
|
else
|
58
60
|
write_failure += 1
|
59
61
|
end
|
62
|
+
log_message_array << log_request_response("info", args, response)
|
60
63
|
rescue StandardError => e
|
61
64
|
handle_exception(e, {
|
62
65
|
context: "KLAVIYO:RECORD:WRITE:FAILURE",
|
@@ -65,12 +68,9 @@ module Multiwoven::Integrations::Destination
|
|
65
68
|
sync_run_id: sync_config.sync_run_id
|
66
69
|
})
|
67
70
|
write_failure += 1
|
71
|
+
log_message_array << log_request_response("error", args, e.message)
|
68
72
|
end
|
69
|
-
|
70
|
-
success: write_success,
|
71
|
-
failed: write_failure
|
72
|
-
)
|
73
|
-
tracker.to_multiwoven_message
|
73
|
+
tracking_message(write_success, write_failure, log_message_array)
|
74
74
|
rescue StandardError => e
|
75
75
|
# TODO: Handle rate limiting seperately
|
76
76
|
handle_exception(e, {
|