]> git.openstreetmap.org Git - chef.git/commitdiff
Use empty hash fallback when loading state file in replicate-changesets
authorAnton Khorev <tony29@yandex.ru>
Wed, 8 Jan 2025 11:21:41 +0000 (14:21 +0300)
committerAnton Khorev <tony29@yandex.ru>
Wed, 8 Jan 2025 11:21:41 +0000 (14:21 +0300)
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]