queue debugging

This commit is contained in:
j 2019-02-01 13:19:19 +05:30
parent b467b93fb6
commit dd48312aff
2 changed files with 3 additions and 1 deletions

View file

@ -317,7 +317,6 @@ class Handler(http.server.SimpleHTTPRequestHandler):
self.send_header('Content-Length', str(content_length))
self.end_headers()
self.wfile.write(content)
logger.debug('%s bytes response', content_length)
def chunk_size(self, content_length):
return min(16*1024, content_length)

View file

@ -504,6 +504,7 @@ class Nodes(Thread):
while not state.shutdown:
args = self._q.get()
if args:
logger.debug('processing nodes queue: next: %s, %s entries in queue', args[0], self._q.qsize())
if args[0] == 'add':
self._add(*args[1:])
elif args[0] == 'pull':
@ -512,6 +513,8 @@ class Nodes(Thread):
self._call(*args)
def queue(self, *args):
if args:
logger.debug('add %s to queue, queue currently has %s entries', args[0], self._q.qsize())
self._q.put(list(args))
def is_online(self, id):