mirror of
https://github.com/nextcloud/server.git
synced 2026-04-21 14:23:17 -04:00
Implement review feedback
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
parent
358eaba7dd
commit
474a5b55d3
2 changed files with 5 additions and 5 deletions
|
|
@ -34,8 +34,8 @@ class Version23000Date20210906132259 extends SimpleMigrationStep {
|
|||
$table->addColumn('delete_after', Types::DATETIME, [
|
||||
'notnull' => true,
|
||||
]);
|
||||
$table->addIndex(['hash'], 'ratelimit_hash_idx');
|
||||
$table->addIndex(['delete_after'], 'ratelimit_delete_after_idx');
|
||||
$table->addIndex(['hash'], 'ratelimit_hash');
|
||||
$table->addIndex(['delete_after'], 'ratelimit_delete_after');
|
||||
return $schema;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class DatabaseBackend implements IBackend {
|
|||
$qb->delete(self::TABLE_NAME)
|
||||
->where(
|
||||
$qb->expr()->lte('delete_after', $qb->createNamedParameter($currentTime, IQueryBuilder::PARAM_DATE))
|
||||
);
|
||||
)
|
||||
->executeStatement();
|
||||
|
||||
$qb = $this->dbConnection->getQueryBuilder();
|
||||
|
|
@ -88,10 +88,10 @@ class DatabaseBackend implements IBackend {
|
|||
);
|
||||
|
||||
$cursor = $qb->executeQuery();
|
||||
$row = $cursor->fetch();
|
||||
$row = $cursor->fetchOne();
|
||||
$cursor->closeCursor();
|
||||
|
||||
return (int)$row['count'];
|
||||
return (int)$row;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue