Skip to content

Commit

Permalink
bug: don't wait for rocket to launch
Browse files Browse the repository at this point in the history
  • Loading branch information
eltorio committed May 5, 2024
1 parent 6ead86f commit 53baadf
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
2 changes: 1 addition & 1 deletion 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
@@ -1,6 +1,6 @@
[package]
name = "hbbs"
version = "1.1.99-6"
version = "1.1.99-7"
authors = ["rustdesk <[email protected]>"]
edition = "2021"
build = "build.rs"
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
rustdesk-server (1.1.99-7) UNRELEASED; urgency=high

* BUG: integrates sctgdesk-api-server

-- sctg <[email protected]> Sun, 05 May 2024 11:22:00 +0800

rustdesk-server (1.1.99-6) UNRELEASED; urgency=low

* integrates sctgdesk-api-server
Expand Down
25 changes: 23 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,34 @@ async fn start_rocket() -> ResultType<()> {
// .merge(("tls.certs", "rustdesk.crt"))
// .merge(("tls.key", "rustdesk.pem"))
.merge(("limits", Limits::new().limit("json", 2.mebibytes())));
let _rocket = build_rocket(figment).await.ignite().await?.launch().await?;
let _rocket = build_rocket(figment).await.ignite().await?.launch();
Ok(())
}

fn log_format(
write: &mut dyn std::io::Write,
now: &mut DeferredNow,
record: &Record,
) -> Result<(), std::io::Error> {
let file = record.file().unwrap_or("unknown");
let line = record.line().unwrap_or(0);
let file = file.rsplitn(2, '/').next().unwrap_or(file); // Obtenez seulement le nom du fichier, pas le chemin complet
let timestamp = now.now().to_string();
write!(
write,
"{} [{}] {}:{} - {}",
timestamp,
record.level(),
file,
line,
record.args()
)
}

fn main() -> ResultType<()> {
let _logger = Logger::try_with_env_or_str("info")?
.log_to_stdout()
.format(opt_format)
.format(log_format)
.write_mode(WriteMode::Async)
.start()?;
let args = format!(
Expand Down

0 comments on commit 53baadf

Please sign in to comment.