metrics agent needs soft deleted shares; kind of the whole point of soft deletes (#262)

This commit is contained in:
Michael Quigley 2023-03-10 11:33:06 -05:00
parent fb14b12446
commit 84f5cd4e55
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
2 changed files with 3 additions and 3 deletions

View File

@ -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
}

View File

@ -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