Skip to content

Commit

Permalink
solve: close #3
Browse files Browse the repository at this point in the history
  • Loading branch information
aeltorio committed Jul 4, 2024
1 parent 32bfc32 commit 64fee8d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ local-ip-address = "0.5.1"
dns-lookup = "1.0.8"
ping = "0.4.0"
sctgdesk-api-server = { git = "https://github.com/sctg-development/sctgdesk-api-server.git", branch = "main" }
# sctgdesk-api-server = { path = "../sctgdesk-api-server" }

rocket = { version = "0.5", features = ["json", "secrets"] }

[build-dependencies]
Expand Down
Binary file modified db_v2.sqlite3
Binary file not shown.
7 changes: 7 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ fn main() -> ResultType<()> {
let serial: i32 = get_arg("serial").parse().unwrap_or(0);

std::env::set_var("MAIN_PKG_VERSION", env!("CARGO_PKG_VERSION"));
let handle = thread::spawn(|| {
let rt = rocket::tokio::runtime::Runtime::new().unwrap();
rt.block_on(async {
let _ = sctgdesk_api_server::ApiState::new_with_db("db_v2.sqlite3").await;
});
});
handle.join().unwrap();
let rocket_thread = thread::spawn(|| {
let _ = start_rocket();
});
Expand Down

0 comments on commit 64fee8d

Please sign in to comment.