Changeset 3718c73


Ignore:
Timestamp:
May 5, 2017 12:26:48 PM (3 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
b0514cc5
Parents:
cd76457
Message:

Reseed: Fix messages about reseed disabled

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/networkdb/reseed/ReseedChecker.java

    rcd76457 r3718c73  
    5151     *  Check if a reseed is needed, and start it
    5252     *
    53      *  @param count current number of known routers
     53     *  @param count current number of known routers, includes us
    5454     *  @return true if a reseed was started
    5555     */
     
    5959
    6060        if (_context.getBooleanProperty(Reseeder.PROP_DISABLE)) {
    61             String s = "Only " + count + " peers remaining but reseed disabled by configuration";
     61            int x = count - 1;  // us
     62            // no ngettext, this is rare
     63            String s;
     64            if (x > 0)
     65                s = "Only " + x + " peers remaining but reseed disabled by configuration";
     66            else
     67                s = "No peers remaining but reseed disabled by configuration";
    6268            _lastError = s;
    6369            _log.logAlways(Log.WARN, s);
     
    6672
    6773        if (_context.router().gracefulShutdownInProgress()) {
    68             String s = "Only " + count + " peers remaining but reseed disabled by shutdown in progress";
     74            int x = count - 1;
     75            // no ngettext, this is rare
     76            String s;
     77            if (x > 0)
     78                s = "Only " + x + " peers remaining but reseed disabled by shutdown in progress";
     79            else
     80                s = "No peers remaining but reseed disabled by shutdown in progress";
    6981            _lastError = s;
    7082            _log.logAlways(Log.WARN, s);
     
    94106            return requestReseed();
    95107        } else {
    96             String s = "Only " + count + " peers remaining but reseed disabled by config file";
     108            int x = count - 1;  // us
     109            // no ngettext, this is rare
     110            String s;
     111            if (x > 0)
     112                s = "Only " + x + " peers remaining but reseed disabled by config file";
     113            else
     114                s = "No peers remaining but reseed disabled by config file";
    97115            _lastError = s;
    98116            _log.logAlways(Log.WARN, s);
Note: See TracChangeset for help on using the changeset viewer.