Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions server/src/handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,10 @@ pub mod logstream;

use actix_web::http::StatusCode;
use actix_web::HttpResponse;
use sysinfo::{System, SystemExt};

use crate::{option::CONFIG, storage::ObjectStorageProvider};

pub async fn liveness() -> HttpResponse {
// If the available memory is less than 100MiB, return a 503 error.
// As liveness check fails, Kubelet will restart the server.
if System::new_all().available_memory() < 100 * 1024 * 1024 {
return HttpResponse::new(StatusCode::SERVICE_UNAVAILABLE);
}

HttpResponse::new(StatusCode::OK)
}

Expand Down