MCPcopy Index your code
hub / github.com/Firstyear/opensuse-proxy-cache / prefetch

Function prefetch

opensuse-proxy-cache/src/main.rs:1092–1119  ·  view source on GitHub ↗
(
    prefetch_tx: Sender<PrefetchReq>,
    submit_tx: &Sender<CacheMeta>,
    prefetch_paths: Option<Vec<PrefetchItem>>,
)

Source from the content-addressed store, hash-verified

1090
1091#[instrument(skip_all)]
1092fn prefetch(
1093 prefetch_tx: Sender<PrefetchReq>,
1094 submit_tx: &Sender<CacheMeta>,
1095 prefetch_paths: Option<Vec<PrefetchItem>>,
1096) {
1097 if let Some(prefetch) = prefetch_paths {
1098 for PrefetchItem {
1099 fetch_url,
1100 cache_key,
1101 tmp_file,
1102 cls,
1103 } in prefetch.into_iter()
1104 {
1105 if prefetch_tx
1106 .try_send(PrefetchReq {
1107 fetch_url,
1108 cache_key,
1109 tmp_file,
1110 submit_tx: submit_tx.clone(),
1111 cls,
1112 })
1113 .is_err()
1114 {
1115 error!("Prefetch task may have died!");
1116 }
1117 }
1118 }
1119}
1120
1121#[instrument(skip_all)]
1122async fn prefetch_dl_task(

Callers 3

head_viewFunction · 0.85
get_viewFunction · 0.85
async_refresh_taskFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected