multiwoven-integrations 0.7.6 → 0.7.8
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: 5064957ae11ed9958ef813d12fb45ff06bd36f77bcb0b06409664d8564c780cb
|
4
|
+
data.tar.gz: 577dc47d95729aa81e3f98994945fb1715f9da72b4437bdaa523ce8914cde4ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04ae67e7a763b3e951efea585b4ef96b7226219acb0bd0fdfa2afa057838a847d4617463036b866e95e830862eb440bf43e18210bb62dcc5b4340952802b8234
|
7
|
+
data.tar.gz: f36f8cbc8b4b9e52c140b8da44e5ac76c5eed33c621268cd5407d0d7c4869902ae10fe4c0047020d1496d8643bcb95452b9376cbff76f79ab2db0bf6da8a2e9a
|
@@ -59,10 +59,12 @@ module Multiwoven
|
|
59
59
|
connection_config = sync_config.destination.connection_specification.with_indifferent_access
|
60
60
|
api_key = connection_config[:api_key]
|
61
61
|
url = sync_config.stream.url
|
62
|
+
log_message_array = []
|
62
63
|
write_success = 0
|
63
64
|
write_failure = 0
|
64
65
|
records.each_slice(MAX_CHUNK_SIZE) do |chunk|
|
65
66
|
payload = create_payload(chunk)
|
67
|
+
args = [sync_config.stream.request_method, url, payload]
|
66
68
|
response = Multiwoven::Integrations::Core::HttpClient.request(
|
67
69
|
url,
|
68
70
|
sync_config.stream.request_method,
|
@@ -74,6 +76,7 @@ module Multiwoven
|
|
74
76
|
else
|
75
77
|
write_failure += chunk.size
|
76
78
|
end
|
79
|
+
log_message_array << log_request_response("info", args, response)
|
77
80
|
rescue StandardError => e
|
78
81
|
handle_exception(e, {
|
79
82
|
context: "AIRTABLE:RECORD:WRITE:EXCEPTION",
|
@@ -82,13 +85,9 @@ module Multiwoven
|
|
82
85
|
sync_run_id: sync_config.sync_run_id
|
83
86
|
})
|
84
87
|
write_failure += chunk.size
|
88
|
+
log_message_array << log_request_response("error", args, e.message)
|
85
89
|
end
|
86
|
-
|
87
|
-
tracker = Multiwoven::Integrations::Protocol::TrackingMessage.new(
|
88
|
-
success: write_success,
|
89
|
-
failed: write_failure
|
90
|
-
)
|
91
|
-
tracker.to_multiwoven_message
|
90
|
+
tracking_message(write_success, write_failure, log_message_array)
|
92
91
|
rescue StandardError => e
|
93
92
|
handle_exception(e, {
|
94
93
|
context: "AIRTABLE:RECORD:WRITE:EXCEPTION",
|
@@ -119,7 +118,7 @@ module Multiwoven
|
|
119
118
|
end
|
120
119
|
|
121
120
|
def base_id_exists?(bases, base_id)
|
122
|
-
return if
|
121
|
+
return if extract_bases(bases).any? { |base| base["id"] == base_id }
|
123
122
|
|
124
123
|
raise ArgumentError, "base_id not found"
|
125
124
|
end
|
@@ -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",
|