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: 9c28512cd0448ff7e826e5425252fb976f61f5e1b2a64ab1c77221934ff8f4ce
4
- data.tar.gz: dcbc3b59cd6a694844bee68741a718634caa5405d73fd9b348f86cd4b1ff87f8
3
+ metadata.gz: 055227f9ec70d01b066063ca9d806514eb0cad47344a60e303b7a5bef9d0056d
4
+ data.tar.gz: 54317d770824c8870ccb58f7b2f852731b8df591cf53fc22ebe80d1b4b1a886e
5
5
  SHA512:
6
- metadata.gz: 965e40b1589563aa28bff12b99ee87beb5437661f195d3912ad2450cb45ae2ff5b0c8a57e7581fe387db6e34dda1acfc3b5248ca93ad386d5ed67e7da0ba3d67
7
- data.tar.gz: 6d2d29049d602e64e5b162a1f5246f2138ba2997aa09b2342beaf9b3031ff3e5fedfd207b93277a7ab55b882611a0ebf9a9e830ed02578caa8757c2d5109c564
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
- tracker = Multiwoven::Integrations::Protocol::TrackingMessage.new(
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, {
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Multiwoven
4
4
  module Integrations
5
- VERSION = "0.7.7"
5
+ VERSION = "0.7.9"
6
6
 
7
7
  ENABLED_SOURCES = %w[
8
8
  Snowflake
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multiwoven-integrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.7
4
+ version: 0.7.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Subin T P