chia-blockchain/chia/util/db_synchronous.py
Kyle Altendorf 3b084a165b
configure isort to add the future annotations import (#13327)
* configure isort to add the future annotations import

* apply the new isort setting

* remove type ignores for new mypy (#13539)

https://pypi.org/project/mypy/0.981/

* another
2022-09-30 03:40:22 -05:00

22 lines
575 B
Python

from __future__ import annotations
def db_synchronous_on(setting: str) -> str:
if setting == "on":
return "NORMAL"
if setting == "off":
return "OFF"
if setting == "full":
return "FULL"
# for now, default to synchronous=FULL mode. This can be made more
# sophisticated in the future. There are still material performance
# improvements to be had in cases where the risks are low.
# e.g.
# type = GetDriveTypeW(db_path)
# if type == DRIVE_FIXED or type == DRIVE_RAMDISK:
# return "OFF"
return "FULL"