ruby_aem_aws 2.2.0 → 2.2.1

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
  SHA1:
3
- metadata.gz: 6e03800c323cf88f17f022f87f3df8bcd3316d95
4
- data.tar.gz: 6288fdc5638777b3160dde0ef53b6e6579292741
3
+ metadata.gz: 889a43cb7a66988ec2ff320e7d3aee6bf253543a
4
+ data.tar.gz: c07c8773e792398b5f83d5dd33fc9e8d777b2650
5
5
  SHA512:
6
- metadata.gz: f62da424b5d615bfb8cb7a057c622335c781e47949cf3a7b590da51f1e8005cc93010bf789ff524019fa1fe5f3fcada98288f58a61880293a1c655094f0c34d6
7
- data.tar.gz: 524f111c5a735488159a963c6354b714a784f9720e0d9556febf923b94a59ffd1d31b2b210ee2870341d924071eeee5608b0946abe6eec38bbe49b62956471fd
6
+ metadata.gz: 02b9dc41c34f82148160b47d8b1c064d8a519c0d9aa5955006d620ac67b8b490fe29580efc8491a8d55da43f37d395439d07148aca83bc36d33a4628f8e1b399
7
+ data.tar.gz: fcccded1753d2f957c8605b2a5811f24bbce6187140607761022bc6fb69e035ae1ebd9a8678e1f57a583030ec266d7a0c194ba81a9bf817ed1929594ba0b5ab2
data/conf/gem.yaml CHANGED
@@ -1 +1 @@
1
- version: 2.2.0
1
+ version: 2.2.1
@@ -36,13 +36,24 @@ module RubyAemAws
36
36
  # @param log_message Log message to filter for
37
37
  # @return Cloudwatch log client filter_log_events response
38
38
  def get_log_event(loggroup_name, log_stream_name, log_message)
39
+ # Initialise response as an empty response having no events and no next token
40
+ # This is needed to handle the scenario when initial filter log events returns
41
+ # a response with nil next token, ensuring the clients of this method to
42
+ # be able to identify any empty response events.
43
+ response = { events: [], next_token: nil }
44
+
39
45
  filter = filter_for_cloudwatch_log_event(loggroup_name, log_stream_name, log_message)
40
- response = cloud_watch_log_client.filter_log_events(filter)
46
+ curr_response = cloud_watch_log_client.filter_log_events(filter)
41
47
 
42
- until response.next_token.nil?
43
- next_token = { next_token: response.next_token }
48
+ # Since late 2021 (circa aws-sdk-cloudwatchlog 1.45.0), the last response
49
+ # is always empty (empty response events and nil next token).
50
+ # Previous to late 2021, the last response used to contain the filtered events
51
+ # with nil next token.
52
+ until curr_response.next_token.nil?
53
+ next_token = { next_token: curr_response.next_token }
44
54
  filter.update(next_token)
45
- response = cloud_watch_client.filter_log_events(filter)
55
+ response = curr_response
56
+ curr_response = cloud_watch_log_client.filter_log_events(filter)
46
57
  end
47
58
 
48
59
  response
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_aem_aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shine Solutions
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-22 00:00:00.000000000 Z
11
+ date: 2021-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk