]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/planet/files/default/replication-bin/replicate-changesets
Fix rubocop warning.
[chef.git] / cookbooks / planet / files / default / replication-bin / replicate-changesets
index b5e6b50d942d910dc529976695bd0f3849bf44fb..e27651c5bd0f71bc69ddad2e43acfdef079e562c 100644 (file)
@@ -199,8 +199,11 @@ class Replicator
     doc.to_s
   end
 
+  def sequence
+    @state.key?("sequence") ? @state["sequence"] + 1 : 0
+  end
+
   def data_stem
-    sequence = (@state.key?("sequence") ? @state["sequence"] + 1 : 0)
     @config["data_dir"] + format("/%03d/%03d/%03d", sequence / 1000000, (sequence / 1000) % 1000, (sequence % 1000))
   end
 
@@ -246,7 +249,7 @@ class Replicator
 
     # fsync the files in their new locations, in case the inodes have
     # changed in the move / copy.
-    fsync(data_fie)
+    fsync(data_file)
     fsync(@config["state_file"])
     fsync(data_state_file)