From 3842b457f8c47904305387c679896e750f521929 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 7 Sep 2016 10:40:20 +0100 Subject: [PATCH] Flush changeset data to disk before making it live --- .rubocop_todo.yml | 2 +- .../planet/files/default/replication-bin/replicate-changesets | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 6bc5812c0..343c145d3 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -27,7 +27,7 @@ Metrics/LineLength: # Offense count: 23 # Configuration parameters: CountComments. Metrics/MethodLength: - Max: 28 + Max: 30 # Offense count: 1 Metrics/PerceivedComplexity: diff --git a/cookbooks/planet/files/default/replication-bin/replicate-changesets b/cookbooks/planet/files/default/replication-bin/replicate-changesets index fb3d6138a..45e1a4a1c 100644 --- a/cookbooks/planet/files/default/replication-bin/replicate-changesets +++ b/cookbooks/planet/files/default/replication-bin/replicate-changesets @@ -196,10 +196,12 @@ class Replicator FileUtils.mkdir_p(File.dirname(data_file)) Zlib::GzipWriter.open(tmp_data) do |fh| fh.write(changeset_dump(open_changesets)) + fh.fdatasync end @state["sequence"] = sequence File.open(tmp_state, "w") do |fh| fh.write(YAML.dump(@state)) + fh.fdatasync end # sanity check: the files we're moving into place -- 2.43.2