forked from LBRYCommunity/lbry-sdk
lint
This commit is contained in:
parent
838cc60161
commit
ec2f6c6b80
1 changed files with 6 additions and 8 deletions
|
@ -7,7 +7,6 @@ from binascii import hexlify
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from contextvars import ContextVar
|
from contextvars import ContextVar
|
||||||
from concurrent.futures.thread import ThreadPoolExecutor
|
|
||||||
from typing import Tuple, List, Union, Callable, Any, Awaitable, Iterable, Dict, Optional
|
from typing import Tuple, List, Union, Callable, Any, Awaitable, Iterable, Dict, Optional
|
||||||
from datetime import date
|
from datetime import date
|
||||||
from prometheus_client import Gauge, Counter, Histogram
|
from prometheus_client import Gauge, Counter, Histogram
|
||||||
|
@ -18,6 +17,12 @@ from .transaction import Transaction, Output, OutputScript, TXRefImmutable, Inpu
|
||||||
from .constants import TXO_TYPES, CLAIM_TYPES
|
from .constants import TXO_TYPES, CLAIM_TYPES
|
||||||
from .util import date_to_julian_day
|
from .util import date_to_julian_day
|
||||||
|
|
||||||
|
from concurrent.futures.thread import ThreadPoolExecutor # pylint: disable=wrong-import-order
|
||||||
|
if platform.system() == 'Windows' or 'ANDROID_ARGUMENT' or 'KIVY_BUILD' in os.environ:
|
||||||
|
from concurrent.futures.thread import ThreadPoolExecutor as ReaderExecutorClass # pylint: disable=reimported
|
||||||
|
else:
|
||||||
|
from concurrent.futures.process import ProcessPoolExecutor as ReaderExecutorClass
|
||||||
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
sqlite3.enable_callback_tracebacks(True)
|
sqlite3.enable_callback_tracebacks(True)
|
||||||
|
@ -61,13 +66,6 @@ def run_read_only_fetchone(sql, params):
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
||||||
if platform.system() == 'Windows' or 'ANDROID_ARGUMENT' or 'KIVY_BUILD' in os.environ:
|
|
||||||
ReaderExecutorClass = ThreadPoolExecutor
|
|
||||||
else:
|
|
||||||
from concurrent.futures.process import ProcessPoolExecutor
|
|
||||||
ReaderExecutorClass = ProcessPoolExecutor
|
|
||||||
|
|
||||||
|
|
||||||
class AIOSQLite:
|
class AIOSQLite:
|
||||||
reader_executor: ReaderExecutorClass
|
reader_executor: ReaderExecutorClass
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue