debugging stuff

This commit is contained in:
Jack 2016-08-19 02:41:23 -04:00
parent 7100345a09
commit 7a54894015
4 changed files with 12 additions and 4 deletions

View file

@ -172,7 +172,7 @@ class ConnectionManager(object):
def pick_best_peer(peers):
# TODO: Eventually rank them based on past performance/reputation. For now
# TODO: just pick the first to which we don't have an open connection
log.debug("Got a list of peers to choose from: %s", str(peers))
log.debug("Got a list of peers to choose from: %s", str(["%s:%i" % (p.host, p.port) for p in peers]))
if peers is None:
return None
for peer in peers:

View file

@ -80,6 +80,7 @@ def disable_noisy_loggers():
logging.getLogger('lbrynet.core.client.ConnectionManager').setLevel(logging.INFO)
logging.getLogger('lbrynet.core.client.BlobRequester').setLevel(logging.INFO)
logging.getLogger('lbrynet.core.client.ClientProtocol').setLevel(logging.INFO)
logging.getLogger('lbrynet.analytics.api').setLevel(logging.INFO)
@_log_decorator

View file

@ -2463,6 +2463,15 @@ class LBRYDaemon(jsonrpc.JSONRPC):
d.addCallbacks(lambda _: self._render_response(True, OK_CODE), lambda err: self._render_response(err.getTraceback(), OK_CODE))
return d
def jsonrpc_get_blobs(self):
"""
return all blobs
"""
d = defer.succeed(self.session.blob_manager.blobs)
d.addCallback(lambda r: self._render_response(r, OK_CODE))
return d
def get_lbrynet_version_from_github():
"""Return the latest released version from github."""

View file

@ -85,9 +85,7 @@ class ReflectorServer(Protocol):
def determine_blob_needed(self, blob):
if blob.is_validated():
d = self.blob_manager.blob_completed(blob)
d.addCallback(lambda _: {'send_blob': False})
return d
return {'send_blob': False}
else:
self.incoming_blob = blob
self.blob_finished_d, self.blob_write, self.cancel_write = blob.open_for_writing(self.peer)