File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1414mod types;
1515
1616use core:: time:: Duration ;
17-
17+ use std :: sync :: LazyLock ;
1818use metrics:: { counter, gauge} ;
1919use tracing:: { debug, error, info, instrument} ;
2020use valveprotos:: deadlock:: c_msg_client_to_gc_get_match_history_response:: EResult ;
@@ -24,6 +24,12 @@ use valveprotos::deadlock::{
2424
2525use crate :: types:: PlayerMatchHistoryEntry ;
2626
27+ static FETCH_INTERVAL_MILLIS : LazyLock < u64 > = LazyLock :: new ( || {
28+ std:: env:: var ( "FETCH_INTERVAL_MILLIS" )
29+ . map ( |x| x. parse ( ) . expect ( "FETCH_INTERVAL_MILLIS must be a number" ) )
30+ . unwrap_or ( 10_000 )
31+ } ) ;
32+
2733#[ tokio:: main]
2834async fn main ( ) -> anyhow:: Result < ( ) > {
2935 common:: init_tracing ( ) ;
@@ -32,7 +38,7 @@ async fn main() -> anyhow::Result<()> {
3238 let http_client = reqwest:: Client :: new ( ) ;
3339 let ch_client = common:: get_ch_client ( ) ?;
3440
35- let mut interval = tokio:: time:: interval ( Duration :: from_secs ( 8 ) ) ;
41+ let mut interval = tokio:: time:: interval ( Duration :: from_millis ( * FETCH_INTERVAL_MILLIS ) ) ;
3642
3743 loop {
3844 let accounts = match fetch_accounts ( & ch_client) . await {
You can’t perform that action at this time.
0 commit comments