···77use std::time::Duration;
88use url::Url;
991010+/// this is for internal use only, please don't use this macro.
1111+#[doc(hidden)]
1212+#[macro_export]
1313+macro_rules! __cfg {
1414+ (@val $key:expr) => {
1515+ std::env::var(concat!("HYDRANT_", $key))
1616+ };
1717+ ($key:expr, $default:expr, sec) => {
1818+ cfg!(@val $key)
1919+ .ok()
2020+ .and_then(|s| humantime::parse_duration(&s).ok())
2121+ .unwrap_or($default)
2222+ };
2323+ ($key:expr, $default:expr) => {
2424+ cfg!(@val $key)
2525+ .ok()
2626+ .and_then(|s| s.parse().ok())
2727+ .unwrap_or($default.to_owned())
2828+ .into()
2929+ };
3030+}
3131+use crate::__cfg as cfg;
3232+1033/// loads `.env` from the current directory, setting any variables not already in the environment.
1134fn load_dotenv() {
1235 let Ok(contents) = std::fs::read_to_string(".env") else {
···366389 /// reads and builds the config from environment variables, loading `.env` first if present.
367390 pub fn from_env() -> Result<Self> {
368391 load_dotenv();
369369-370370- macro_rules! cfg {
371371- (@val $key:expr) => {
372372- std::env::var(concat!("HYDRANT_", $key))
373373- };
374374- ($key:expr, $default:expr, sec) => {
375375- cfg!(@val $key)
376376- .ok()
377377- .and_then(|s| humantime::parse_duration(&s).ok())
378378- .unwrap_or($default)
379379- };
380380- ($key:expr, $default:expr) => {
381381- cfg!(@val $key)
382382- .ok()
383383- .and_then(|s| s.parse().ok())
384384- .unwrap_or($default.to_owned())
385385- .into()
386386- };
387387- }
388392389393 // full_network is read first since it determines which defaults to use.
390394 let full_network: bool = cfg!("FULL_NETWORK", false);
+2-2
src/control/repos.rs
···5757/// control over which repositories are tracked and access to their state.
5858///
5959/// in `filter` mode, a repo is only indexed if it either matches a signal or is
6060-/// explicitly tracked via [`ReposControl::track`]. in `full` mode all repos are indexed
6161-/// and tracking is implicit.
6060+/// explicitly tracked via [`ReposControl::track`]. in `full` mode all repos are
6161+/// indexed and tracking is implicit.
6262///
6363/// tracking a DID that hydrant has never seen enqueues an immediate backfill.
6464/// tracking a DID that hydrant already knows about (but has marked untracked)