Log less precise time for connection cleanup

This commit is contained in:
shortcutme 2018-10-30 04:41:02 +01:00
parent 083d64d151
commit d89d770e73
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -231,11 +231,11 @@ class ConnectionServer(object):
connection.unpacker = None
elif connection.last_cmd_sent == "announce" and idle > 20: # Bootstrapper connection close after 20 sec
connection.close("[Cleanup] Tracker connection: %s" % idle)
connection.close("[Cleanup] Tracker connection, idle: %.3fs" % idle)
if idle > 60 * 60:
# Wake up after 1h
connection.close("[Cleanup] After wakeup, idle: %s" % idle)
connection.close("[Cleanup] After wakeup, idle: %.3fs" % idle)
elif idle > 20 * 60 and connection.last_send_time < time.time() - 10:
# Idle more than 20 min and we have not sent request in last 10 sec