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

Method expiry

opensuse-proxy-cache/src/cache.rs:199–229  ·  view source on GitHub ↗
(&self, etime: OffsetDateTime)

Source from the content-addressed store, hash-verified

197 }
198
199 pub fn expiry(&self, etime: OffsetDateTime) -> Option<(OffsetDateTime, OffsetDateTime)> {
200 match self {
201 // We can now do async prefetching on bg refreshes so this keeps everything in sync.
202 Classification::RepomdXmlSlow => Some((
203 // We had to lower this because upstream often gets out of sync
204 etime + time::Duration::minutes(1),
205 etime + time::Duration::hours(24),
206 )),
207 Classification::RepomdXmlFast => Some((
208 etime + time::Duration::minutes(1),
209 etime + time::Duration::minutes(180),
210 )),
211 Classification::Metadata => Some((
212 etime + time::Duration::minutes(15),
213 etime + time::Duration::hours(24),
214 )),
215 Classification::Blob => Some((
216 // etime + time::Duration::hours(2),
217 etime + time::Duration::minutes(15),
218 etime + time::Duration::hours(336),
219 )),
220 Classification::Static => Some((
221 // Because OBS keeps publishing incorrect shit ...
222 // etime + time::Duration::hours(2),
223 etime + time::Duration::minutes(15),
224 etime + time::Duration::hours(336),
225 )),
226 Classification::Unknown => Some((etime, etime + time::Duration::minutes(5))),
227 Classification::Spam => None,
228 }
229 }
230}
231
232pub struct Cache {

Callers 1

cache_mgrFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected