fix url server name retreival

This commit is contained in:
2026-06-13 17:44:34 +02:00
parent 9ba7ac5c70
commit 3791a8b04e
2 changed files with 3 additions and 2 deletions

View File

@ -6,7 +6,7 @@
/* By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 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;
if let Some(capture) = reg.captures(&self.handshake.as_ref().unwrap().server_address) {
if let Some(captured_str) = capture.get(1) {

View File

@ -22,6 +22,7 @@ async fn server_init(pool: &DbPool, _docker: &Docker) -> Result<(), String> {
.or(status.eq(ServerStatus::Starting))
))
.set(status.eq(ServerStatus::Stopped)).execute(conn);
println!("init done");
Ok(())
}