fluent-plugin-cloudwatch-ingest 0.1.12 → 0.1.13
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da60017312c17b0017c447f0dd8b7da2c4803457
|
4
|
+
data.tar.gz: 9cfaec4d46eef8edd93155f00f7372759b3d4992
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe01a1b5df0135ddcaf47e24b0c4f0c9cddcc628f92c051fb59a0ed718d629496296c73a0b342762ecfb337635b28d237f91812522d2a139a256f3ca5a6cf7e4
|
7
|
+
data.tar.gz: 65de4d5cee4a6aa6f1422ba5f9b89bac09e714757fe39951db77a160a7f0d786ba3587b99f39fe13c008570ec96905c4eec74b173b820b767cfb0ee26aa3306e
|
@@ -191,10 +191,12 @@ module Fluent::Plugin
|
|
191
191
|
attr_accessor :statefile
|
192
192
|
|
193
193
|
def initialize(filepath, log)
|
194
|
-
|
195
|
-
|
194
|
+
if File.exist?(statefile)
|
195
|
+
self.statefile = Pathname.new(filepath).open('r+')
|
196
|
+
else
|
196
197
|
log.warn("No state file #{statefile} Creating a new one.")
|
197
198
|
begin
|
199
|
+
self.statefile = Pathname.new(filepath).open('w+')
|
198
200
|
save
|
199
201
|
rescue => boom
|
200
202
|
log.error("Unable to create new state file #{statefile}: #{boom}")
|
@@ -212,6 +214,7 @@ module Fluent::Plugin
|
|
212
214
|
end
|
213
215
|
|
214
216
|
def save
|
217
|
+
statefile.rewind
|
215
218
|
statefile.write(YAML.dump(self))
|
216
219
|
log.info("Saved state to #{statefile}")
|
217
220
|
end
|