@cryptotaxi247 / kubo / commits / 6e863830b

some comments

License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>

Jeromy committed Feb 1, 2016 at 16:39 UTC 6e863830bf84a532575606a1876a110a7a11e36e
1 file changed +2
commands/reqlog.go
+2
@@ -71,6 +71,7 @@ func (rl *ReqLog) maybeCleanup() {
71
72 func (rl *ReqLog) cleanup() {
73 var i int
74 + // drop all logs at are inactive and more than an hour old
75 for ; i < len(rl.Requests); i++ {
76 req := rl.Requests[i]
77 if req.Active || req.EndTime.Add(time.Hour).After(time.Now()) {
@@ -89,6 +90,7 @@ func (rl *ReqLog) cleanup() {
90 }
91 }
92
93 +// Report generates a copy of all the entries in the requestlog
94 func (rl *ReqLog) Report() []*ReqLogEntry {
95 rl.lock.Lock()
96 defer rl.lock.Unlock()