♻️ Ajustes menores
This commit is contained in:
parent
da8604980d
commit
46d4e19c39
6 changed files with 6 additions and 15 deletions
|
|
@ -5,7 +5,6 @@ use crate::config;
|
|||
|
||||
use substring::Substring;
|
||||
|
||||
|
||||
pub fn print_on_startup() {
|
||||
if config::SETTINGS.app.startup_banner.to_lowercase() != "off" {
|
||||
if let Some((term_width, _)) = term_size::dimensions() {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ use crate::db::*;
|
|||
use sea_orm::{ConnectOptions, ConnectionTrait, Database, DatabaseBackend, Statement};
|
||||
use tracing_unwrap::ResultExt;
|
||||
|
||||
|
||||
pub static DBCONN: LazyStatic<DbConn> = LazyStatic::new(|| {
|
||||
trace::info!(
|
||||
"Connecting to database \"{}\" using a pool of {} connections",
|
||||
|
|
@ -61,7 +60,6 @@ pub static DBCONN: LazyStatic<DbConn> = LazyStatic::new(|| {
|
|||
.expect_or_log("Failed to connect to database")
|
||||
});
|
||||
|
||||
|
||||
static DBBACKEND: LazyStatic<DatabaseBackend> = LazyStatic::new(||
|
||||
DBCONN.get_database_backend()
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2,11 +2,9 @@ use crate::{config, trace, LazyStatic};
|
|||
|
||||
use unic_langid::LanguageIdentifier;
|
||||
|
||||
// LOCALIZACIÓN ************************************************************************************
|
||||
|
||||
/// Almacena el Identificador de Idioma Unicode
|
||||
/// ([Unicode Language Identifier](https://unicode.org/reports/tr35/tr35.html#Unicode_language_identifier))
|
||||
/// global para la aplicación, obtenido de `SETTINGS.app.language`.
|
||||
/// para la aplicación, obtenido de `SETTINGS.app.language`.
|
||||
pub static LANGID: LazyStatic<LanguageIdentifier> =
|
||||
LazyStatic::new(|| match config::SETTINGS.app.language.parse() {
|
||||
Ok(language) => language,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ use crate::{config, LazyStatic};
|
|||
use tracing_appender::non_blocking::WorkerGuard;
|
||||
use tracing_subscriber::EnvFilter;
|
||||
|
||||
|
||||
/// Registro de trazas y eventos de la aplicación.
|
||||
///
|
||||
/// Para aumentar el rendimiento, un subproceso dedicado utiliza un sistema de escritura sin bloqueo
|
||||
|
|
|
|||
|
|
@ -78,12 +78,11 @@
|
|||
//! );
|
||||
//! ```
|
||||
//!
|
||||
//! De hecho, así se declaran los ajustes globales de la configuración (ver
|
||||
//! [`SETTINGS`](crate::global::SETTINGS)).
|
||||
//! De hecho, así se declaran los ajustes globales de la configuración (ver [`SETTINGS`]).
|
||||
//!
|
||||
//! Puedes usar la [sintaxis TOML](https://toml.io/en/v1.0.0#table) para añadir tu nueva sección
|
||||
//! `[myapp]` en los archivos de configuración, del mismo modo que se añaden `[log]` o `[server]` en
|
||||
//! los ajustes globales (ver [`Settings`](crate::global::Settings)).
|
||||
//! los ajustes globales (ver [`Settings`]).
|
||||
//!
|
||||
//! Se recomienda inicializar todos los ajustes con valores predefinidos, o utilizar la notación
|
||||
//! `Option<T>` si van a ser tratados en el código como opcionales.
|
||||
|
|
@ -100,9 +99,9 @@
|
|||
//! use pagetop::prelude::*;
|
||||
//!
|
||||
//! fn global_settings() {
|
||||
//! println!("App name: {}", &global::SETTINGS.app.name);
|
||||
//! println!("App description: {}", &global::SETTINGS.app.description);
|
||||
//! println!("Value of PAGETOP_RUN_MODE: {}", &global::SETTINGS.app.run_mode);
|
||||
//! println!("App name: {}", &config::SETTINGS.app.name);
|
||||
//! println!("App description: {}", &config::SETTINGS.app.description);
|
||||
//! println!("Value of PAGETOP_RUN_MODE: {}", &config::SETTINGS.app.run_mode);
|
||||
//! }
|
||||
//!
|
||||
//! fn module_settings() {
|
||||
|
|
@ -128,7 +127,6 @@ use serde::Deserialize;
|
|||
|
||||
use std::env;
|
||||
|
||||
|
||||
/// Directorio donde se encuentran los archivos de configuración.
|
||||
const CONFIG_DIR: &str = "config";
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ pub use url::Url as DbUri;
|
|||
|
||||
pub use sea_orm::{DatabaseConnection as DbConn, ExecResult, QueryResult};
|
||||
|
||||
|
||||
// El siguiente módulo migration es una versión simplificada del módulo sea_orm_migration (v0.9.1)
|
||||
// https://github.com/SeaQL/sea-orm/tree/0.9.1/sea-orm-migration para evitar los errores generados
|
||||
// por el paradigma modular de PageTop. Se copian los siguientes archivos del original:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue