Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Romira915 committed Apr 5, 2023
1 parent 283166a commit 344f291
Showing 1 changed file with 30 additions and 12 deletions.
42 changes: 30 additions & 12 deletions homeserver_receive_process/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,11 @@ async fn post_minecraft(
) -> impl Responder {
log::info!("post minecraft");

if state.lock().unwrap().current_executing_count() >= 2 {
return HttpResponse::ExpectationFailed().body("Two games have already been activated.");
{
if state.lock().unwrap().current_executing_count() >= 2 {
return HttpResponse::ExpectationFailed()
.body("Two games have already been activated.");
}
}

let result = exec_systemctl(&command, Game::MinecraftServerMgpf).await;
Expand All @@ -116,8 +119,11 @@ async fn post_sdtd(
) -> impl Responder {
log::info!("post sdtd");

if state.lock().unwrap().current_executing_count() >= 2 {
return HttpResponse::ExpectationFailed().body("Two games have already been activated.");
{
if state.lock().unwrap().current_executing_count() >= 2 {
return HttpResponse::ExpectationFailed()
.body("Two games have already been activated.");
}
}

let result = exec_systemctl(&command, Game::SdtdServer).await;
Expand All @@ -144,8 +150,11 @@ async fn post_terraria(
) -> impl Responder {
log::info!("post terraria");

if state.lock().unwrap().current_executing_count() >= 2 {
return HttpResponse::ExpectationFailed().body("Two games have already been activated.");
{
if state.lock().unwrap().current_executing_count() >= 2 {
return HttpResponse::ExpectationFailed()
.body("Two games have already been activated.");
}
}

let result = exec_systemctl(&command, Game::TerrariaServer).await;
Expand All @@ -172,8 +181,11 @@ async fn post_ark(
) -> impl Responder {
log::info!("post ark");

if state.lock().unwrap().current_executing_count() >= 2 {
return HttpResponse::ExpectationFailed().body("Two games have already been activated.");
{
if state.lock().unwrap().current_executing_count() >= 2 {
return HttpResponse::ExpectationFailed()
.body("Two games have already been activated.");
}
}

let result = exec_systemctl(&command, Game::ArkServer).await;
Expand All @@ -200,8 +212,11 @@ async fn post_ark_second(
) -> impl Responder {
log::info!("post ark-second");

if state.lock().unwrap().current_executing_count() >= 2 {
return HttpResponse::ExpectationFailed().body("Two games have already been activated.");
{
if state.lock().unwrap().current_executing_count() >= 2 {
return HttpResponse::ExpectationFailed()
.body("Two games have already been activated.");
}
}

let result = exec_systemctl(&command, Game::ArkServerSecond).await;
Expand All @@ -228,8 +243,11 @@ async fn post_ark_third(
) -> impl Responder {
log::info!("post ark-third");

if state.lock().unwrap().current_executing_count() >= 2 {
return HttpResponse::ExpectationFailed().body("Two games have already been activated.");
{
if state.lock().unwrap().current_executing_count() >= 2 {
return HttpResponse::ExpectationFailed()
.body("Two games have already been activated.");
}
}

let result = exec_systemctl(&command, Game::ArkServerThird).await;
Expand Down

0 comments on commit 344f291

Please sign in to comment.