X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/276750ebe30538b39c2d756dc4e784afa2c974ab..d6f5ba8921adc01c2d090a04f6928995078b0126:/cookbooks/planet/files/default/replication-bin/replicate-changesets diff --git a/cookbooks/planet/files/default/replication-bin/replicate-changesets b/cookbooks/planet/files/default/replication-bin/replicate-changesets index b5e6b50d9..e27651c5b 100644 --- a/cookbooks/planet/files/default/replication-bin/replicate-changesets +++ b/cookbooks/planet/files/default/replication-bin/replicate-changesets @@ -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)