mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2026-08-29 10:06:27 -05:00
24 lines
597 B
Python
24 lines
597 B
Python
# Package: utils
|
|
|
|
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=NORMAL 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 "NORMAL"
|