conditional import
This commit is contained in:
parent
310c61a5cc
commit
838cc60161
1 changed files with 1 additions and 1 deletions
|
@ -8,7 +8,6 @@ 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 concurrent.futures.thread import ThreadPoolExecutor
|
||||||
from concurrent.futures.process import ProcessPoolExecutor
|
|
||||||
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
|
||||||
|
@ -65,6 +64,7 @@ def run_read_only_fetchone(sql, params):
|
||||||
if platform.system() == 'Windows' or 'ANDROID_ARGUMENT' or 'KIVY_BUILD' in os.environ:
|
if platform.system() == 'Windows' or 'ANDROID_ARGUMENT' or 'KIVY_BUILD' in os.environ:
|
||||||
ReaderExecutorClass = ThreadPoolExecutor
|
ReaderExecutorClass = ThreadPoolExecutor
|
||||||
else:
|
else:
|
||||||
|
from concurrent.futures.process import ProcessPoolExecutor
|
||||||
ReaderExecutorClass = ProcessPoolExecutor
|
ReaderExecutorClass = ProcessPoolExecutor
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue