refactor: reorganize backend modules and create lib.rs

This commit is contained in:
2025-12-11 16:28:28 -06:00
parent d4454d7367
commit e23c01e4fd
5 changed files with 55 additions and 54 deletions

View File

@@ -6,7 +6,6 @@ use salvo::{http::cookie::Cookie, Response};
use tokio::sync::Mutex;
use crate::models::{BuildLogs, Executable, ExecutableJson, Session};
use crate::utility::search;
pub static STORE: LazyLock<Mutex<State>> = LazyLock::new(|| Mutex::new(State::new()));
@@ -32,7 +31,7 @@ impl State {
let data = std::fs::read(exe_path).expect("Unable to read file");
let pattern = "a".repeat(1024);
let key_start = search(&data, pattern.as_bytes(), 0).unwrap();
let key_start = Executable::search_pattern(&data, pattern.as_bytes(), 0).unwrap();
let key_end = key_start + pattern.len();
let path = path::Path::new(&exe_path);