mirror of
https://github.com/openziti/zrok.git
synced 2025-02-16 18:20:51 +01: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
|
||||
}
|
||||
defer func() { _ = tx.Rollback() }()
|
||||
shr, err := sc.str.FindShareWithZId(svcZId, tx)
|
||||
shr, err := sc.str.FindShareWithZIdAndDeleted(svcZId, tx)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
@ -63,9 +63,9 @@ func (self *Store) FindShareWithToken(shrToken string, tx *sqlx.Tx) (*Share, err
|
||||
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{}
|
||||
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 shr, nil
|
||||
|
Loading…
Reference in New Issue
Block a user