mirror of
https://github.com/openziti/zrok.git
synced 2025-06-20 09:48:07 +02:00
metrics agent needs soft deleted shares; kind of the whole point of soft deletes (#262)
This commit is contained in:
parent
fb14b12446
commit
84f5cd4e55
@ -23,7 +23,7 @@ func (sc *shareCache) getToken(svcZId string) (string, error) {
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
defer func() { _ = tx.Rollback() }()
|
defer func() { _ = tx.Rollback() }()
|
||||||
shr, err := sc.str.FindShareWithZId(svcZId, tx)
|
shr, err := sc.str.FindShareWithZIdAndDeleted(svcZId, tx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
@ -63,9 +63,9 @@ func (self *Store) FindShareWithToken(shrToken string, tx *sqlx.Tx) (*Share, err
|
|||||||
return shr, nil
|
return shr, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *Store) FindShareWithZId(zId string, tx *sqlx.Tx) (*Share, error) {
|
func (self *Store) FindShareWithZIdAndDeleted(zId string, tx *sqlx.Tx) (*Share, error) {
|
||||||
shr := &Share{}
|
shr := &Share{}
|
||||||
if err := tx.QueryRowx("select * from shares where z_id = $1 and not deleted", zId).StructScan(shr); err != nil {
|
if err := tx.QueryRowx("select * from shares where z_id = $1", zId).StructScan(shr); err != nil {
|
||||||
return nil, errors.Wrap(err, "error selecting share by z_id")
|
return nil, errors.Wrap(err, "error selecting share by z_id")
|
||||||
}
|
}
|
||||||
return shr, nil
|
return shr, nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user