chore: fix format and clippy
This commit is contained in:
parent
fe4d138a14
commit
fcb928bf74
@ -200,11 +200,9 @@ impl ProviderAnalyticsService {
|
|||||||
}
|
}
|
||||||
task_count += 1;
|
task_count += 1;
|
||||||
|
|
||||||
if let Some(outcome) = obj.get("outcome").and_then(|v| v.as_str()) {
|
if matches!(obj.get("outcome").and_then(|v| v.as_str()), Some("success")) {
|
||||||
if outcome == "success" {
|
|
||||||
successful_count += 1;
|
successful_count += 1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(duration) = obj.get("duration_ms").and_then(|v| v.as_u64()) {
|
if let Some(duration) = obj.get("duration_ms").and_then(|v| v.as_u64()) {
|
||||||
total_duration_ms += duration;
|
total_duration_ms += duration;
|
||||||
@ -235,6 +233,7 @@ impl ProviderAnalyticsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Get cost forecast for a provider
|
/// Get cost forecast for a provider
|
||||||
|
#[allow(clippy::excessive_nesting)]
|
||||||
pub async fn forecast_provider_costs(
|
pub async fn forecast_provider_costs(
|
||||||
&self,
|
&self,
|
||||||
provider: &str,
|
provider: &str,
|
||||||
@ -271,14 +270,12 @@ impl ProviderAnalyticsService {
|
|||||||
|
|
||||||
if let Some(executed_at) = obj.get("executed_at").and_then(|v| v.as_str()) {
|
if let Some(executed_at) = obj.get("executed_at").and_then(|v| v.as_str()) {
|
||||||
let date_str = executed_at.split('T').next().unwrap_or("").to_string();
|
let date_str = executed_at.split('T').next().unwrap_or("").to_string();
|
||||||
|
if let Some(ref last_date) = &last_date_str {
|
||||||
if let Some(ref last_date) = last_date_str {
|
|
||||||
if last_date != &date_str && current_day_cost > 0 {
|
if last_date != &date_str && current_day_cost > 0 {
|
||||||
daily_costs.push(current_day_cost);
|
daily_costs.push(current_day_cost);
|
||||||
current_day_cost = 0;
|
current_day_cost = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
last_date_str = Some(date_str);
|
last_date_str = Some(date_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ use thiserror::Error;
|
|||||||
use crate::workflow::state::{Phase, StepStatus, Workflow, WorkflowStep};
|
use crate::workflow::state::{Phase, StepStatus, Workflow, WorkflowStep};
|
||||||
|
|
||||||
#[derive(Debug, Error)]
|
#[derive(Debug, Error)]
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code, clippy::enum_variant_names)]
|
||||||
pub enum ParserError {
|
pub enum ParserError {
|
||||||
#[error("Failed to read file: {0}")]
|
#[error("Failed to read file: {0}")]
|
||||||
FileError(#[from] std::io::Error),
|
FileError(#[from] std::io::Error),
|
||||||
|
|||||||
@ -24,6 +24,7 @@ pub struct Scheduler;
|
|||||||
impl Scheduler {
|
impl Scheduler {
|
||||||
/// Resolve dependencies using topological sort (Kahn's algorithm)
|
/// Resolve dependencies using topological sort (Kahn's algorithm)
|
||||||
/// Returns levels of steps that can be executed in parallel
|
/// Returns levels of steps that can be executed in parallel
|
||||||
|
#[allow(clippy::excessive_nesting)]
|
||||||
pub fn resolve_dependencies(
|
pub fn resolve_dependencies(
|
||||||
steps: &[WorkflowStep],
|
steps: &[WorkflowStep],
|
||||||
) -> Result<Vec<Vec<String>>, SchedulerError> {
|
) -> Result<Vec<Vec<String>>, SchedulerError> {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user