Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try to solve warnings on cargo test command #3

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/container/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use std::sync::{Arc, OnceLock};
use std::time::{Duration, SystemTime};
use tokio::task::JoinHandle;
use uuid::Uuid;
use volumes::{detach_volume, VolumeData, VolumeMount};
use volumes::{detach_volume, VolumeMount};

use crate::api::status::update_instance_store_cache;
use crate::config::{
Expand Down
2 changes: 1 addition & 1 deletion src/container/rolling_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async fn perform_rolling_update(
let server_backends = SERVER_BACKENDS
.get()
.expect("Server backends not initialized");
let log = slog_scope::logger();
let _log = slog_scope::logger();

let pods: Vec<_> = {
let instances = instance_store
Expand Down
4 changes: 1 addition & 3 deletions src/container/runtimes/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ use std::time::Duration;
use uuid::Uuid;

use crate::config::{get_config_by_service, parse_cpu_limit, parse_memory_limit, ServiceConfig};

use crate::container::volumes::{attach_volume, create_named_volume, VOLUME_STORE};
use crate::container::{
parse_network_rate, update_container_stats, Container, ContainerInfo, ContainerPortMetadata,
ContainerRuntime, ContainerStats, NetworkLimit,
Expand Down Expand Up @@ -303,7 +301,7 @@ impl ContainerRuntime for DockerRuntime {

async fn check_image_updates(
&self,
service_name: &str,
_service_name: &str,
containers: &[Container],
current_hashes: &HashMap<String, String>,
) -> Result<HashMap<String, bool>> {
Expand Down
7 changes: 4 additions & 3 deletions src/container/scale.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// src/container/scale.rs
use anyhow::{anyhow, Result};
use anyhow::{Result};
use pingora_load_balancing::Backend;
use std::{
collections::HashMap,
Expand Down Expand Up @@ -210,7 +210,7 @@ pub async fn auto_scale(service_name: String) {

for (_, stats) in &pod_stats {
let memory_percentage = if stats.memory_limit > 0 {
(stats.memory_usage as f64 / stats.memory_limit as f64 * 100.0)
stats.memory_usage as f64 / stats.memory_limit as f64 * 100.0
} else {
0.0
};
Expand Down Expand Up @@ -552,6 +552,7 @@ pub async fn scale_down(
}

// Health check function
#[warn(dead_code)]
async fn wait_for_container_health(
container_name: &str,
runtime: Arc<dyn ContainerRuntime>,
Expand Down Expand Up @@ -585,7 +586,7 @@ async fn wait_for_container_health(

false
}

#[warn(dead_code)]
async fn check_application_readiness(addr: &str, port: u16, timeout: Duration) -> bool {
use tokio::net::TcpStream;

Expand Down
2 changes: 1 addition & 1 deletion src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ pub async fn run_proxy_for_service(service_name: String, config: ServiceConfig)
}

// Only create proxies for containers requesting external access
for (node_port, container_port) in service_ports {
for (node_port, _container_port) in service_ports {
let proxy_key = format!("{}_{}", service_name, node_port);

if let Some(backends) = server_backends.get(&proxy_key) {
Expand Down