Moving country data refresh interval 15 minutes again
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use log::info;
|
||||
|
||||
use crate::country_statistics::country_nodes_distribution::CountryNodesDistribution;
|
||||
use crate::MIXNODE_REFRESH_INTERVAL;
|
||||
use crate::COUNTRY_DATA_REFRESH_INTERVAL;
|
||||
|
||||
use crate::state::ExplorerApiStateContext;
|
||||
|
||||
@@ -17,8 +17,9 @@ impl CountryStatisticsDistributionTask {
|
||||
pub(crate) fn start(mut self) {
|
||||
info!("Spawning mix node country distribution task runner...");
|
||||
tokio::spawn(async move {
|
||||
let mut interval_timer =
|
||||
tokio::time::interval(std::time::Duration::from_secs(MIXNODE_REFRESH_INTERVAL)); // every 15 mins
|
||||
let mut interval_timer = tokio::time::interval(std::time::Duration::from_secs(
|
||||
COUNTRY_DATA_REFRESH_INTERVAL,
|
||||
));
|
||||
loop {
|
||||
// wait for the next interval tick
|
||||
interval_timer.tick().await;
|
||||
|
||||
@@ -13,7 +13,7 @@ mod ping;
|
||||
mod state;
|
||||
|
||||
const GEO_IP_SERVICE: &str = "https://api.freegeoip.app/json";
|
||||
const MIXNODE_REFRESH_INTERVAL: u64 = 30;
|
||||
const COUNTRY_DATA_REFRESH_INTERVAL: u64 = 60 * 15; // every 15 minutes
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
|
||||
Reference in New Issue
Block a user