Allow purge interval to be set, and fix variable naming

This commit is contained in:
Justin Li
2014-07-16 13:54:10 -04:00
parent 84e1c169c0
commit 1236a5ee5b
2 changed files with 16 additions and 7 deletions
+2 -2
View File
@@ -208,12 +208,12 @@ func (c *Conn) DeleteClient(peerID string) error {
}
func (c *Conn) PurgeInactiveTorrents(before time.Time) error {
unix := before.Unix()
unixtime := before.Unix()
var queue []string
c.torrentsM.RLock()
for key, torrent := range c.torrents {
if torrent.LastAction < unix {
if torrent.LastAction < unixtime {
queue = append(queue, key)
}
}