diff --git a/api/lib/LoginThrottle.php b/api/lib/LoginThrottle.php index e1952350..fce40235 100644 --- a/api/lib/LoginThrottle.php +++ b/api/lib/LoginThrottle.php @@ -78,6 +78,9 @@ final class LoginThrottle /** Removes the files of addresses whose failures are all too old to matter. */ public function prune(): int { + // PHP keeps what it learned of a file for the rest of the request; a time read earlier + // would keep a file that has gone stale since, or drop one written since. + clearstatcache(); $removed = 0; foreach (glob($this->dir . '/*.json') ?: [] as $path) { if ((int) filemtime($path) < $this->now() - 2 * self::WINDOW_SECONDS && unlink($path)) {