This avoids needing to sync data again when renaming it.
sequence = (@state.key?("sequence") ? @state["sequence"] + 1 : 0)
data_file = @config["data_dir"] + format("/%03d/%03d/%03d.osm.gz", sequence / 1000000, (sequence / 1000) % 1000, (sequence % 1000))
tmp_state = @config["state_file"] + ".tmp"
sequence = (@state.key?("sequence") ? @state["sequence"] + 1 : 0)
data_file = @config["data_dir"] + format("/%03d/%03d/%03d.osm.gz", sequence / 1000000, (sequence / 1000) % 1000, (sequence % 1000))
tmp_state = @config["state_file"] + ".tmp"
- tmp_data = "/tmp/changeset_data.osm.tmp"
+ tmp_data = data_file + ".tmp"
# try and write the files to tmp locations and then
# move them into place later, to avoid in-progress
# clashes, or people seeing incomplete files.
# try and write the files to tmp locations and then
# move them into place later, to avoid in-progress
# clashes, or people seeing incomplete files.