X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fconfig.rs;fp=src%2Fconfig.rs;h=bf5a171e4502f015044fef70a75af6c64b94d20c;hb=588cdca5a6c278a71faa8d0235ae6ba7d0b51ee5;hp=1f968d6418760b880cd1db6862ecf892b9446dc7;hpb=0fd2f7802c6fc631415813270d78069d0d394913;p=rapid-gossip-sync-server diff --git a/src/config.rs b/src/config.rs index 1f968d6..bf5a171 100644 --- a/src/config.rs +++ b/src/config.rs @@ -30,8 +30,13 @@ pub(crate) fn network() -> Network { } } -pub(crate) fn network_graph_cache_path() -> &'static str { - "./res/network_graph.bin" +pub(crate) fn network_graph_cache_path() -> String { + format!("{}/network_graph.bin", cache_path()) +} + +pub(crate) fn cache_path() -> String { + let path = env::var("RAPID_GOSSIP_SYNC_SERVER_CACHES_PATH").unwrap_or("./res".to_string()).to_lowercase(); + path } pub(crate) fn db_connection_config() -> Config {