mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-11-22 20:08:48 +00:00
feat: Add startup_time field to ChargingEngine for tracking service uptime
- Add SystemTime import from std::time - Add startup_time field to ChargingEngine struct - Initialize startup_time with SystemTime::now() during engine creation
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::time::Duration;
|
use std::time::{Duration, SystemTime};
|
||||||
|
|
||||||
use super::types::{RatingPlan, SubscriberAccount};
|
use super::types::{RatingPlan, SubscriberAccount};
|
||||||
use crate::errors::{ChargingError, ChargingResult, ErrorContext};
|
use crate::errors::{ChargingError, ChargingResult, ErrorContext};
|
||||||
@@ -8,6 +8,7 @@ pub struct ChargingEngine {
|
|||||||
redis_client: redis::Client,
|
redis_client: redis::Client,
|
||||||
rating_plans: HashMap<String, RatingPlan>,
|
rating_plans: HashMap<String, RatingPlan>,
|
||||||
sync_interval: Duration,
|
sync_interval: Duration,
|
||||||
|
startup_time: SystemTime,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ChargingEngine {
|
impl ChargingEngine {
|
||||||
@@ -58,6 +59,7 @@ impl ChargingEngine {
|
|||||||
redis_client,
|
redis_client,
|
||||||
rating_plans,
|
rating_plans,
|
||||||
sync_interval: Duration::from_secs(sync_interval_secs),
|
sync_interval: Duration::from_secs(sync_interval_secs),
|
||||||
|
startup_time: SystemTime::now(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user