Merge branch 'master' into fix-collectionUpdateWithReplace

This commit is contained in:
Alex Grin 2021-05-18 15:25:40 -04:00 committed by GitHub
commit e1a44c93f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 10 deletions

View file

@ -132,7 +132,7 @@ class SourceManager:
else: else:
streams = list(self._sources.values()) streams = list(self._sources.values())
if sort_by: if sort_by:
streams.sort(key=lambda s: getattr(s, sort_by)) streams.sort(key=lambda s: getattr(s, sort_by) or "")
if reverse: if reverse:
streams.reverse() streams.reverse()
return streams return streams

View file

@ -5,7 +5,6 @@ from typing import Union, Tuple, Set, List
from itertools import chain from itertools import chain
from decimal import Decimal from decimal import Decimal
from collections import namedtuple from collections import namedtuple
from multiprocessing import Manager
from binascii import unhexlify, hexlify from binascii import unhexlify, hexlify
from lbry.wallet.server.leveldb import LevelDB from lbry.wallet.server.leveldb import LevelDB
from lbry.wallet.server.util import class_logger from lbry.wallet.server.util import class_logger
@ -220,7 +219,6 @@ class SQLDB:
self.db = None self.db = None
self.logger = class_logger(__name__, self.__class__.__name__) self.logger = class_logger(__name__, self.__class__.__name__)
self.ledger = Ledger if main.coin.NET == 'mainnet' else RegTestLedger self.ledger = Ledger if main.coin.NET == 'mainnet' else RegTestLedger
self.state_manager = None
self.blocked_streams = None self.blocked_streams = None
self.blocked_channels = None self.blocked_channels = None
self.blocking_channel_hashes = { self.blocking_channel_hashes = {
@ -251,11 +249,10 @@ class SQLDB:
self.execute(self.PRAGMAS) self.execute(self.PRAGMAS)
self.execute(self.CREATE_TABLES_QUERY) self.execute(self.CREATE_TABLES_QUERY)
register_canonical_functions(self.db) register_canonical_functions(self.db)
self.state_manager = Manager() self.blocked_streams = {}
self.blocked_streams = self.state_manager.dict() self.blocked_channels = {}
self.blocked_channels = self.state_manager.dict() self.filtered_streams = {}
self.filtered_streams = self.state_manager.dict() self.filtered_channels = {}
self.filtered_channels = self.state_manager.dict()
self.update_blocked_and_filtered_claims() self.update_blocked_and_filtered_claims()
for algorithm in self.trending: for algorithm in self.trending:
algorithm.install(self.db) algorithm.install(self.db)
@ -263,8 +260,6 @@ class SQLDB:
def close(self): def close(self):
if self.db is not None: if self.db is not None:
self.db.close() self.db.close()
if self.state_manager is not None:
self.state_manager.shutdown()
def update_blocked_and_filtered_claims(self): def update_blocked_and_filtered_claims(self):
self.update_claims_from_channel_hashes( self.update_claims_from_channel_hashes(