From 84f5cd4e558384b8f8373977d64d27fa10409ff0 Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Fri, 10 Mar 2023 11:33:06 -0500 Subject: [PATCH] metrics agent needs soft deleted shares; kind of the whole point of soft deletes (#262) --- controller/metrics/shareCache.go | 2 +- controller/store/share.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controller/metrics/shareCache.go b/controller/metrics/shareCache.go index 69ce4c88..2789953d 100644 --- a/controller/metrics/shareCache.go +++ b/controller/metrics/shareCache.go @@ -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 } diff --git a/controller/store/share.go b/controller/store/share.go index d14423e7..86e55c61 100644 --- a/controller/store/share.go +++ b/controller/store/share.go @@ -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