Turn on gevent block logging by default

This commit is contained in:
shortcutme 2018-01-27 12:15:18 +01:00
parent aad1a836db
commit cc48a0ad86
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
2 changed files with 11 additions and 13 deletions

View file

@ -179,7 +179,6 @@ class Config(object):
self.parser.add_argument('--debug', help='Debug mode', action='store_true')
self.parser.add_argument('--silent', help='Disable logging to terminal output', action='store_true')
self.parser.add_argument('--debug_socket', help='Debug socket connections', action='store_true')
self.parser.add_argument('--debug_gevent', help='Debug gevent functions', action='store_true')
self.parser.add_argument('--batch', help="Batch mode (No interactive input for commands)", action='store_true')

View file

@ -46,12 +46,11 @@ def formatStack():
# Test if gevent eventloop blocks
if config.debug_gevent:
import logging
import gevent
import time
import logging
import gevent
import time
def testBlock():
def testBlock():
logging.debug("Gevent block checker started")
last_time = time.time()
while 1:
@ -59,7 +58,7 @@ if config.debug_gevent:
if time.time() - last_time > 1.1:
logging.debug("Gevent block detected: %s" % (time.time() - last_time - 1))
last_time = time.time()
gevent.spawn(testBlock)
gevent.spawn(testBlock)
if __name__ == "__main__":