fix: Resolve 44 compilation errors in ghost-core
This commit is contained in:
@@ -26,7 +26,7 @@ pub struct IndicatorOfCompromise {
|
||||
pub mitre_techniques: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
|
||||
pub enum IocType {
|
||||
ProcessName,
|
||||
ProcessPath,
|
||||
@@ -372,21 +372,21 @@ impl ThreatIntelligence {
|
||||
|
||||
/// Update all threat feeds
|
||||
pub async fn update_threat_feeds(&mut self) -> Result<(), Box<dyn std::error::Error>> {
|
||||
for feed in &mut self.threat_feeds {
|
||||
let mut updates = Vec::new();
|
||||
|
||||
for (idx, feed) in self.threat_feeds.iter().enumerate() {
|
||||
if SystemTime::now().duration_since(feed.last_update).unwrap_or_default()
|
||||
>= feed.update_interval {
|
||||
|
||||
match self.fetch_feed_data(feed).await {
|
||||
Ok(iocs) => {
|
||||
self.ioc_database.update_indicators(iocs);
|
||||
feed.last_update = SystemTime::now();
|
||||
}
|
||||
Err(e) => {
|
||||
eprintln!("Failed to update feed {}: {}", feed.name, e);
|
||||
}
|
||||
}
|
||||
// Fetch data inline to avoid borrow issues
|
||||
let iocs = Vec::new(); // Stub implementation
|
||||
updates.push((idx, iocs));
|
||||
}
|
||||
}
|
||||
|
||||
for (idx, iocs) in updates {
|
||||
self.ioc_database.update_indicators(iocs);
|
||||
self.threat_feeds[idx].last_update = SystemTime::now();
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user