This commit is contained in:
Bradley Nelson
2026-06-17 00:28:10 -06:00
parent 4427b1613b
commit b3e1e42e93
13 changed files with 419 additions and 95 deletions
+14
View File
@@ -650,6 +650,20 @@ impl AppServiceFactory {
)
.start();
// Periodic idle-eviction of cached compiled modules: frees the
// memory of plugins not invoked within the configured TTL; the
// next event recompiles transparently. Cheap, so it ticks often.
{
let evictor = manager.clone();
tokio::spawn(async move {
let mut tick = tokio::time::interval(std::time::Duration::from_secs(60));
loop {
tick.tick().await;
evictor.evict_idle_compiled();
}
});
}
return (Some(dispatch), Some(management));
}
}