MCPcopy Create free account
hub / github.com/chatmail/core / http_cache_cleanup

Function http_cache_cleanup

src/net/http.rs:247–260  ·  view source on GitHub ↗

Removes expired cache entries.

(context: &Context)

Source from the content-addressed store, hash-verified

245
246/// Removes expired cache entries.
247pub(crate) async fn http_cache_cleanup(context: &Context) -> Result<()> {
248 // Remove cache entries that are already expired
249 // or entries that will not expire in a year
250 // to make sure we don't have invalid timestamps that are way forward in the future.
251 context
252 .sql
253 .execute(
254 "DELETE FROM http_cache
255 WHERE ?1 > expires OR expires > ?1 + 31536000",
256 (time(),),
257 )
258 .await?;
259 Ok(())
260}
261
262/// Fetches URL and updates the cache.
263///

Callers 1

housekeepingFunction · 0.85

Calls 2

timeFunction · 0.85
executeMethod · 0.80

Tested by

no test coverage detected