Reason for connection closing

This commit is contained in:
shortcutme 2017-02-27 00:02:24 +01:00
parent 75100c335f
commit bad2a79f05
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
5 changed files with 41 additions and 49 deletions

View file

@ -77,7 +77,7 @@ class FileRequest(object):
self.log.debug("Delay %s %s, cpu_time used by connection: %.3fs" % (self.connection.ip, cmd, self.connection.cpu_time))
time.sleep(self.connection.cpu_time)
if self.connection.cpu_time > 5:
self.connection.close()
self.connection.close("Cpu time: %.3fs" % self.connection.cpu_time)
if func:
func(params)
else: