mirror of
https://github.com/openziti/zrok.git
synced 2025-08-26 23:04:29 +02:00
added batch limits
This commit is contained in:
@@ -44,8 +44,8 @@ func (self *Store) FindAccountRequestWithToken(token string, tx *sqlx.Tx) (*Acco
|
||||
return ar, nil
|
||||
}
|
||||
|
||||
func (self *Store) FindExpiredAccountRequests(before time.Time, tx *sqlx.Tx) ([]*AccountRequest, error) {
|
||||
rows, err := tx.Queryx("select * from account_requests where created_at < $1", before)
|
||||
func (self *Store) FindExpiredAccountRequests(before time.Time, limit int, tx *sqlx.Tx) ([]*AccountRequest, error) {
|
||||
rows, err := tx.Queryx(fmt.Sprintf("select * from account_requests where created_at < $1 limit %d for update", limit), before)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "error selecting expired account_requests")
|
||||
}
|
||||
|
Reference in New Issue
Block a user