diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-05-09 10:19:16 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-05-09 10:19:16 -0400 |
commit | a2ddc10462b78f14655e3fe22eeacdc7532f5687 (patch) | |
tree | c028c150f47c7bd43a967f423443b852ca60a754 /shell/db.js | |
parent | 859c0e775ddd3163a827118a071085583d7e7830 (diff) | |
download | mongo-a2ddc10462b78f14655e3fe22eeacdc7532f5687.tar.gz |
fix printSlaveReplicationInfo for unsynced state SERVER-1106
Diffstat (limited to 'shell/db.js')
-rw-r--r-- | shell/db.js | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/shell/db.js b/shell/db.js index 04c8af10ee4..31f58b6508b 100644 --- a/shell/db.js +++ b/shell/db.js @@ -626,13 +626,19 @@ DB.prototype.printReplicationInfo = function() { DB.prototype.printSlaveReplicationInfo = function() { function g(x) { + assert( x , "how could this be null (printSlaveReplicationInfo gx)" ) print("source: " + x.host); - var st = new Date( DB.tsToSeconds( x.syncedTo ) * 1000 ); - var now = new Date(); - print("syncedTo: " + st.toString() ); - var ago = (now-st)/1000; - var hrs = Math.round(ago/36)/100; - print(" = " + Math.round(ago) + "secs ago (" + hrs + "hrs)"); + if ( x.syncedTo ){ + var st = new Date( DB.tsToSeconds( x.syncedTo ) * 1000 ); + var now = new Date(); + print("\t syncedTo: " + st.toString() ); + var ago = (now-st)/1000; + var hrs = Math.round(ago/36)/100; + print("\t\t = " + Math.round(ago) + "secs ago (" + hrs + "hrs)"); + } + else { + print( "\t doing initial sync" ); + } } var L = this.getSisterDB("local"); if( L.sources.count() == 0 ) { |