mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-10 12:47:25 -04:00
Compare commits
1 Commits
v0.3.0-alp
...
v0.3.0-alp
| Author | SHA1 | Date | |
|---|---|---|---|
| 90b6ad400d |
@@ -69,8 +69,16 @@ def get_db_path(base_db_path: str) -> str:
|
|||||||
Example:
|
Example:
|
||||||
PROD: "data/trading.db" -> "data/trading.db"
|
PROD: "data/trading.db" -> "data/trading.db"
|
||||||
DEV: "data/trading.db" -> "data/trading_dev.db"
|
DEV: "data/trading.db" -> "data/trading_dev.db"
|
||||||
|
|
||||||
|
Note:
|
||||||
|
This function is idempotent - calling it multiple times on the same
|
||||||
|
path will not add multiple _dev suffixes.
|
||||||
"""
|
"""
|
||||||
if is_dev_mode():
|
if is_dev_mode():
|
||||||
|
# Check if already has _dev suffix (idempotent)
|
||||||
|
if "_dev.db" in base_db_path:
|
||||||
|
return base_db_path
|
||||||
|
|
||||||
# Insert _dev before .db extension
|
# Insert _dev before .db extension
|
||||||
if base_db_path.endswith(".db"):
|
if base_db_path.endswith(".db"):
|
||||||
return base_db_path[:-3] + "_dev.db"
|
return base_db_path[:-3] + "_dev.db"
|
||||||
|
|||||||
Reference in New Issue
Block a user