openstreetmap / trac-tickets

Archived Trac Tickets
1 stars 1 forks source link

osmosis --read-replication-lag crashes when lag < 61 seconds #5036

Open openstreetmap-trac opened 3 years ago

openstreetmap-trac commented 3 years ago

Reporter: wambacher [Submitted to the original trac issue database at 10.20am, Wednesday, 20th November 2013]

hi, i'm using osmosis to update my planet-database with diff-files. at the end of my script i run osmosis -q --read-replication-lag humanReadable=yes workingDirectory=. to get the actual lag.

It's crashing when the lag is less than 61 Seconds. See Log.

The fix is quite simple: in ReplicationLagReader.java change

                                // just some seconds
                System.out.println(
                    new MessageFormat("{0} second(s)").format(lag)
                );

to

                                // just some seconds
                                Object[] args = {lag};
                System.out.println(
                    new MessageFormat("{0} second(s)").format(args)
                );

sorry, no patch and no git. never done that.

openstreetmap-trac commented 3 years ago

Author: wambacher [Added to the original trac issue at 11.09am, Wednesday, 20th November 2013]

btw: if the lag is less then 61 seconds, is's allways 60 or zero - does that make sense?

regards

walter