mirror of
https://github.com/BreizhHardware/ntfy_alerts.git
synced 2026-01-18 16:37:28 +01:00
fix(api, docker, github, models): Suppress unused variable warnings by adding #[allow(dead_code)]
This commit is contained in:
@@ -483,7 +483,7 @@ async fn delete_docker_repo(body: RepoRequest, db: Arc<Mutex<Connection>>) -> Re
|
||||
|
||||
async fn get_latest_updates(db: Arc<Mutex<Connection>>) -> Result<impl Reply, Rejection> {
|
||||
let updates = {
|
||||
let db_guard = db.lock().await;
|
||||
let _db_guard = db.lock().await;
|
||||
|
||||
let db_path = env::var("DB_PATH").unwrap_or_else(|_| "/github-ntfy".to_string());
|
||||
let versions_path = format!("{}/ghntfy_versions.db", db_path);
|
||||
|
||||
@@ -150,8 +150,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let github_releases = github::get_latest_releases(&github_repos, &client, config.github_headers()).await;
|
||||
let docker_releases = docker::get_latest_docker_releases(&docker_repos, &client, config.docker_headers()).await;
|
||||
|
||||
notifications::send_notifications(github_releases, docker_releases, &config, &conn_versions).await;
|
||||
let _ = notifications::send_notifications(github_releases, docker_releases, &config, &conn_versions).await;
|
||||
|
||||
tokio::time::sleep(Duration::from_secs_f64(config.timeout)).await;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ pub struct GithubRelease {
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct GithubReleaseInfo {
|
||||
pub repo: String,
|
||||
#[allow(dead_code)]
|
||||
pub name: String,
|
||||
pub tag_name: String,
|
||||
pub html_url: String,
|
||||
@@ -36,6 +37,7 @@ pub struct DockerReleaseInfo {
|
||||
pub published_at: String,
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub struct NotifiedRelease {
|
||||
pub repo: String,
|
||||
pub tag_name: String,
|
||||
|
||||
@@ -19,6 +19,7 @@ pub async fn send_to_slack(release: DockerReleaseInfo, webhook_url: &str) {
|
||||
slack::send_docker_notification(&release, webhook_url).await;
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub async fn send_notifications(releases: &[DockerReleaseInfo], config: &Config) {
|
||||
let mut tasks = Vec::new();
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ pub async fn send_to_slack(release: GithubReleaseInfo, webhook_url: &str) {
|
||||
slack::send_github_notification(&release, webhook_url).await;
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub async fn send_notifications(releases: &[GithubReleaseInfo], config: &Config) {
|
||||
let mut tasks = Vec::new();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user