last_run = (@now - 60) if last_run.nil?
@state['last_run'] = @now
# pretty much all operations on a changeset will modify its closed_at
- # time (see rails_port's changeset model). so it is probably enough
+ # time (see rails_port's changeset model). so it is probably enough
# for us to look at anything that was closed recently, and filter from
# there.
@conn.
select {|cs| cs.activity_between?(last_run, @now) }
end
- # creates an XML file containing the changeset information from the
+ # creates an XML file containing the changeset information from the
# list of changesets output by open_changesets.
def changeset_dump(changesets)
doc = XML::Document.new
xml['created_at'] = cs.created_at.getutc.xmlschema
xml['closed_at'] = cs.closed_at.getutc.xmlschema if cs.closed?(@now)
xml['open'] = cs.open?(@now).to_s
- xml['num_changes'] = cs.num_changes
+ xml['num_changes'] = cs.num_changes.to_s
res = @conn.exec("select u.id, u.display_name, c.min_lat, c.max_lat, c.min_lon, c.max_lon from users u join changesets c on u.id=c.user_id where c.id=#{cs.id}")
xml['user'] = res[0]['display_name']
doc.root << xml
end
-
+
doc.to_s
end
rep = Replicator.new(ARGV[0])
rep.save!
-