Mirror von
https://github.com/Chaoscaot/schemsearch
synchronisiert 2024-11-19 10:20:08 +01:00
Fixes
Dieser Commit ist enthalten in:
Ursprung
98d797532e
Commit
9e7d5ea424
@ -169,7 +169,7 @@ fn main() {
|
|||||||
Some(x) => x
|
Some(x) => x
|
||||||
};
|
};
|
||||||
|
|
||||||
file = match std::fs::File::create(output_file_path) {
|
file = match File::create(output_file_path) {
|
||||||
Ok(x) => Some(x),
|
Ok(x) => Some(x),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
cmd.error(ErrorKind::Io, format!("Error while creating output file: {}", e.to_string())).exit();
|
cmd.error(ErrorKind::Io, format!("Error while creating output file: {}", e.to_string())).exit();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
use sqlx::{Executor, MySql, Pool, Row};
|
use sqlx::{Executor, MySql, MySqlPool, Pool, Row};
|
||||||
use sqlx::mysql::MySqlPoolOptions;
|
use sqlx::mysql::MySqlConnectOptions;
|
||||||
|
|
||||||
mod properties;
|
mod properties;
|
||||||
|
|
||||||
@ -15,9 +15,14 @@ pub async unsafe fn get_connection() {
|
|||||||
let mut conn = CONN.lock().unwrap();
|
let mut conn = CONN.lock().unwrap();
|
||||||
if conn.is_none() {
|
if conn.is_none() {
|
||||||
let properties = properties::load_mysql_properties();
|
let properties = properties::load_mysql_properties();
|
||||||
let _ = conn.insert(MySqlPoolOptions::new()
|
let _ = conn.insert(MySqlPool::connect_with(
|
||||||
.max_connections(5)
|
MySqlConnectOptions::new()
|
||||||
.connect(&format!("mysql://{}:{}@{}/{}", properties.user, properties.password, properties.host, properties.database))
|
.host(properties.host.as_str())
|
||||||
|
.port(3306)
|
||||||
|
.username(properties.user.as_str())
|
||||||
|
.password(properties.password.as_str())
|
||||||
|
.database(properties.database.as_str())
|
||||||
|
)
|
||||||
.await.expect("Failed to connect to database"));
|
.await.expect("Failed to connect to database"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren