fix: изменен пайплайн конфигов во избежания ошибок в работе

This commit is contained in:
2026-04-20 19:10:30 +03:00
parent ac75ab08c2
commit 788541ab2b
5 changed files with 13 additions and 14 deletions

View File

@@ -5,7 +5,8 @@
make_db_connection = function(scheme, where = "") {
if (getOption("APP.DEBUG", FALSE)) message("=== DB CONNECT ", where)
DBI::dbConnect(RSQLite::SQLite(), fs::path(
config::get("form_db_path"),
config::get("form_app_configure_path"),
"db",
scheme,
ext = "sqlite"
))

View File

@@ -10,8 +10,7 @@ set_global_options = function(
config_params_to_check <- c(
"form_app_version",
"form_db_path",
"form_configs_path",
"form_app_configure_path",
"form_auth_enabled",
"form_id",
"form_name"
@@ -41,22 +40,22 @@ check_and_init_scheme = function() {
cli::cli_inform(c("*" = "проверка схемы..."))
options(box.path = config::get("form_configs_path"))
box::use(enabled/enabled_schemes[enabled_schemes])
options(box.path = config::get("form_app_configure_path"))
box::use(configs/enabled_schemes[enabled_schemes])
files_to_watch <- c(
fs::path(config::get("form_configs_path"), "enabled", "enabled_schemes.R"),
fs::path(config::get("form_app_configure_path"), "configs", "enabled_schemes.R"),
"modules/scheme_generator.R",
"modules/utils.R"
)
scheme_names <- enabled_schemes
scheme_file <- paste0(config::get("form_configs_path"), "/schemas/", scheme_names, ".xlsx")
scheme_file <- paste0(config::get("form_app_configure_path"), "/configs/schemas/", scheme_names, ".xlsx")
scheme_file <- stats::setNames(scheme_file, scheme_names)
if (!all(file.exists(scheme_file))) cli::cli_abort(c("Отсутствуют файлы схем для следующих наименований:", paste("-", names(scheme_file)[!file.exists(scheme_file)])))
db_files <- paste0(config::get("form_db_path"), "/", scheme_names, ".sqlite")
db_files <- paste0(config::get("form_app_configure_path"), "/db/", scheme_names, ".sqlite")
hash_file <- "temp/schema_hash.rds"
@@ -99,7 +98,8 @@ init_scheme = function(scheme_file) {
modules/scheme_generator[scheme_R6]
)
if (!dir.exists(config::get("form_db_path"))) dir.create(config::get("form_db_path"))
db_path <- fs::path(config::get("form_app_configure_path"), "db")
if (!dir.exists(db_path)) dir.create(db_path)
cli::cli_h1("Инициализация схемы")
schms <- purrr::map2(