Moving country data refresh interval 15 minutes again

This commit is contained in:
Dave Hrycyszyn
2021-12-20 10:35:04 +00:00
parent 84924133b5
commit ea3f2e9beb
2 changed files with 5 additions and 4 deletions
@@ -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;
+1 -1
View File
@@ -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() {