fix bug pulling blob length out of the database

This commit is contained in:
Jimmy Kiselak 2015-09-10 21:43:46 -04:00
parent ff5b6c4eab
commit 0836d9c5ee

View file

@ -293,7 +293,7 @@ class DiskBlobManager(BlobManager):
@rerun_if_locked
def _get_blob_length(self, blob):
d = self.db_conn.runQuery("select blob_length from blobs where blob_hash = ?", (blob,))
d.addCallback(lambda r: r[0] if len(r) else Failure(NoSuchBlobError(blob)))
d.addCallback(lambda r: r[0][0] if len(r) else Failure(NoSuchBlobError(blob)))
return d
#length, verified_time, next_announce_time = json.loads(self.db.Get(blob))