diff options
author | Pavlo Strokov <pstrokov@gitlab.com> | 2021-10-18 16:04:34 +0300 |
---|---|---|
committer | Pavlo Strokov <pstrokov@gitlab.com> | 2021-10-26 12:45:55 +0300 |
commit | 942c72a2db396711f6685c85109b4d560fcdae88 (patch) | |
tree | e5dae143779b78f99d08fa69bc96740624439464 | |
parent | 4dfeec9150239893f1de8a94d972af8624542e2c (diff) |
sql: NewStorageCleanup accepts Querier
Change *sql.DB to glsql.Querier to get more
flexibility in testing for the StorageCleanup.
-rw-r--r-- | internal/praefect/datastore/storage_cleanup.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/praefect/datastore/storage_cleanup.go b/internal/praefect/datastore/storage_cleanup.go index 2041828b1..01e7f5868 100644 --- a/internal/praefect/datastore/storage_cleanup.go +++ b/internal/praefect/datastore/storage_cleanup.go @@ -9,6 +9,7 @@ import ( "github.com/lib/pq" "gitlab.com/gitlab-org/gitaly/v14/internal/helper" + "gitlab.com/gitlab-org/gitaly/v14/internal/praefect/datastore/glsql" ) // RepositoryClusterPath identifies location of the repository in the cluster. @@ -38,13 +39,13 @@ type ClusterPath struct { } // NewStorageCleanup initialises and returns a new instance of the StorageCleanup. -func NewStorageCleanup(db *sql.DB) *StorageCleanup { +func NewStorageCleanup(db glsql.Querier) *StorageCleanup { return &StorageCleanup{db: db} } // StorageCleanup provides methods on the database for the repository cleanup operation. type StorageCleanup struct { - db *sql.DB + db glsql.Querier } // Populate adds storage to the set, so it can be acquired afterwards. |