X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/18e12b0e123fc3e5f344682f884feabc12da0f5a..17cb6dc0ff516c27a12c7fd62b08ce28e9779a83:/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 fac548bd5..29131b2ed 100755 --- a/cookbooks/planet/files/default/replication-bin/replicate-changesets +++ b/cookbooks/planet/files/default/replication-bin/replicate-changesets @@ -143,7 +143,7 @@ class Replicator def initialize(config) @config = YAML.safe_load(File.read(config)) @state = YAML.safe_load(File.read(@config["state_file"]), [Time]) - @conn = PGconn.connect(@config["db"]) + @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] end @@ -278,7 +278,7 @@ class Replicator fl.flock(File::LOCK_UN) rescue StandardError - STDERR.puts("Error! Couldn't update state.") + warn "Error! Couldn't update state." fl.flock(File::LOCK_UN) raise end @@ -290,6 +290,6 @@ begin rep = Replicator.new(ARGV[0]) rep.save! rescue StandardError => e - STDERR.puts "ERROR: #{e.message}" + warn "ERROR: #{e.message}" exit 1 end