Improve dead instances pruning

This fixes a couple edge cases in which inactive but working instances could be caught by the dead instances filter
This commit is contained in:
Laura Hausmann 2024-01-30 18:00:54 +01:00
parent 0d28b07203
commit 7ed43b76b5
Signed by: zotan
GPG key ID: D044E84C5BE01605

View file

@ -40,7 +40,10 @@ export async function skippedInstances(
.andWhere( .andWhere(
new Brackets((qb) => { new Brackets((qb) => {
qb.where("instance.isSuspended") qb.where("instance.isSuspended")
.orWhere("instance.lastCommunicatedAt < :deadTime", { deadTime }); .orWhere(new Brackets((qb) => {
qb.where("instance.isNotResponding")
.andWhere("instance.lastCommunicatedAt < :deadTime", { deadTime });
}));
}), }),
) )
.select("host") .select("host")