]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/planet/files/default/replication-bin/replicate-changesets
Use empty hash fallback when loading state file in replicate-changesets
[chef.git] / cookbooks / planet / files / default / replication-bin / replicate-changesets
index c87183fbb1a54969660497a4a1c0b33e358ff9a9..a57ca7659e42beacae9e884fb61a9cf758b56ae4 100755 (executable)
@@ -139,7 +139,7 @@ end
 class Replicator
   def initialize(config)
     @config = YAML.safe_load(File.read(config))
-    @state = YAML.safe_load(File.read(@config["state_file"]), :permitted_classes => [Time])
+    @state = YAML.safe_load(File.read(@config["state_file"]), :permitted_classes => [Time], :fallback => {})
     @conn = PG::Connection.connect(@config["db"])
     # get current time from the database rather than the current system
     @now = @conn.exec("select now() as now").map { |row| Time.parse(row["now"]) }[0]