Release the locks of a killed restore when it runs again; legacy test without empty folders

A killed restore left its leases for up to two hours, so the first backup of the recovered
server was refused. A backup from before 1.0.3 records no empty folders: the test now expects that.
This commit is contained in:
2026-11-06 17:34:33 +01:00
parent b14b16c66c
commit d96229f370
6 changed files with 38 additions and 7 deletions
+9
View File
@@ -76,6 +76,15 @@ final class LeaseService {
$qb->executeStatement();
}
/** Remove the shared leases on $name, for a caller that knows their holders were stopped. */
public function dropShared(string $name): void {
$qb = $this->db->getQueryBuilder();
$qb->delete('ngb_leases')
->where($qb->expr()->eq('name', $qb->createNamedParameter($name)))
->andWhere($qb->expr()->eq('mode', $qb->createNamedParameter(self::SHARED)));
$qb->executeStatement();
}
/** Wraps $refresh so calling it often (per file, per row batch) only touches the database every $seconds. */
public static function throttled(callable $refresh, int $seconds = 60): \Closure {
$last = time();