Fix runners not disappearing

This commit is contained in:
Joscha 2023-08-10 23:35:20 +02:00
parent 2079d0b12d
commit b16b3a668e
5 changed files with 10 additions and 8 deletions

View file

@ -35,9 +35,11 @@ impl Runners {
}
}
pub fn clean(&mut self, now: OffsetDateTime) {
pub fn clean(&mut self) -> &mut Self {
let now = OffsetDateTime::now_utc();
self.runners
.retain(|_, v| now <= v.last_seen + self.config.web_runner_timeout)
.retain(|_, v| now <= v.last_seen + self.config.web_runner_timeout);
self
}
pub fn verify(&self, name: &str, secret: &str) -> bool {