mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-11-09 17:36:14 +03:00
3b084a165b
* 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
22 lines
575 B
Python
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"
|