forked from LBRYCommunity/lbry-sdk
limit blobs to announce
This commit is contained in:
parent
e414cc5c48
commit
da9b4e317a
1 changed files with 7 additions and 5 deletions
|
@ -308,16 +308,18 @@ class SQLiteStorage(SQLiteMixin):
|
||||||
r = transaction.execute(
|
r = transaction.execute(
|
||||||
"select blob_hash from blob "
|
"select blob_hash from blob "
|
||||||
"where blob_hash is not null and "
|
"where blob_hash is not null and "
|
||||||
"(should_announce=1 or single_announce=1) and next_announce_time<? and status='finished'",
|
"(should_announce=1 or single_announce=1) and next_announce_time<? and status='finished' "
|
||||||
(timestamp,)
|
"order by next_announce_time asc limit ?",
|
||||||
|
(timestamp, int(self.conf.concurrent_blob_announcers * 10))
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
r = transaction.execute(
|
r = transaction.execute(
|
||||||
"select blob_hash from blob where blob_hash is not null "
|
"select blob_hash from blob where blob_hash is not null "
|
||||||
"and next_announce_time<? and status='finished'", (timestamp,)
|
"and next_announce_time<? and status='finished' "
|
||||||
|
"order by next_announce_time asc limit ?",
|
||||||
|
(timestamp, int(self.conf.concurrent_blob_announcers * 10))
|
||||||
)
|
)
|
||||||
blobs = [b[0] for b in r.fetchall()]
|
return [b[0] for b in r.fetchall()]
|
||||||
return blobs
|
|
||||||
return self.db.run(get_and_update)
|
return self.db.run(get_and_update)
|
||||||
|
|
||||||
def delete_blobs_from_db(self, blob_hashes):
|
def delete_blobs_from_db(self, blob_hashes):
|
||||||
|
|
Loading…
Reference in a new issue