mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-23 12:30:41 +01:00
fix(vault): offset in sql query
This commit is contained in:
parent
0a31f76300
commit
84fdfa4623
@ -235,6 +235,14 @@ func (d *SqlDb) getObjects(projectID int, props db.ObjectProps, params db.Retrie
|
||||
q = q.OrderBy("pe." + orderColumn + " " + orderDirection)
|
||||
}
|
||||
|
||||
if params.Count > 0 {
|
||||
q = q.Limit(uint64(params.Count))
|
||||
}
|
||||
|
||||
if params.Offset > 0 {
|
||||
q = q.Offset(uint64(params.Offset))
|
||||
}
|
||||
|
||||
query, args, err := q.ToSql()
|
||||
|
||||
if err != nil {
|
||||
|
@ -2,6 +2,7 @@ package sql
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"errors"
|
||||
"github.com/ansible-semaphore/semaphore/db"
|
||||
)
|
||||
|
||||
@ -115,7 +116,7 @@ func (d *SqlDb) RekeyAccessKeys(oldKey string) (err error) {
|
||||
key.OverrideSecret = true
|
||||
err = d.UpdateAccessKey(key)
|
||||
|
||||
if err != nil {
|
||||
if err != nil && !errors.Is(err, db.ErrNotFound) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user