fix url server name retreival
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
/* By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2026/05/07 17:23:09 by tomoron #+# #+# */
|
/* Created: 2026/05/07 17:23:09 by tomoron #+# #+# */
|
||||||
/* Updated: 2026/06/12 19:04:11 by tomoron ### ########.fr */
|
/* Updated: 2026/06/13 17:43:46 by tomoron ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ impl Client {
|
|||||||
|
|
||||||
let conn = &mut self.db_pool.get().unwrap();
|
let conn = &mut self.db_pool.get().unwrap();
|
||||||
|
|
||||||
let reg = Regex::new(r"^(?:([a-zA-Z-_]*)\.)?mc\.tmoron\.fr").unwrap();
|
let reg = Regex::new(r"^(?:([0-9a-zA-Z\-_]*)\.)?mc\.tmoron\.fr").unwrap();
|
||||||
let mut found: Option<String> = None;
|
let mut found: Option<String> = None;
|
||||||
if let Some(capture) = reg.captures(&self.handshake.as_ref().unwrap().server_address) {
|
if let Some(capture) = reg.captures(&self.handshake.as_ref().unwrap().server_address) {
|
||||||
if let Some(captured_str) = capture.get(1) {
|
if let Some(captured_str) = capture.get(1) {
|
||||||
|
|||||||
@ -22,6 +22,7 @@ async fn server_init(pool: &DbPool, _docker: &Docker) -> Result<(), String> {
|
|||||||
.or(status.eq(ServerStatus::Starting))
|
.or(status.eq(ServerStatus::Starting))
|
||||||
))
|
))
|
||||||
.set(status.eq(ServerStatus::Stopped)).execute(conn);
|
.set(status.eq(ServerStatus::Stopped)).execute(conn);
|
||||||
|
println!("init done");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user