mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Don't query the bruteforce attempts when we just deleted them
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
3a1ef2b012
commit
1d550ab95e
1 changed files with 6 additions and 2 deletions
|
|
@ -66,6 +66,8 @@ class Throttler {
|
|||
private $logger;
|
||||
/** @var IConfig */
|
||||
private $config;
|
||||
/** @var bool */
|
||||
private $hasAttemptsDeleted = false;
|
||||
|
||||
/**
|
||||
* @param IDBConnection $db
|
||||
|
|
@ -230,7 +232,7 @@ class Throttler {
|
|||
$maxAgeHours = 48;
|
||||
}
|
||||
|
||||
if ($ip === '') {
|
||||
if ($ip === '' || $this->hasAttemptsDeleted) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -306,7 +308,9 @@ class Throttler {
|
|||
->andWhere($qb->expr()->eq('action', $qb->createNamedParameter($action)))
|
||||
->andWhere($qb->expr()->eq('metadata', $qb->createNamedParameter(json_encode($metadata))));
|
||||
|
||||
$qb->execute();
|
||||
$qb->executeStatement();
|
||||
|
||||
$this->hasAttemptsDeleted = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue