Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement metadata storage #2656

Merged
merged 41 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WIP
  • Loading branch information
Dmitry committed May 18, 2023
commit a9f5a6e9c56ff74e30650620e0514eb615b33891
2 changes: 1 addition & 1 deletion internal/backends/sqlite/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type NewBackendParams struct {

// NewBackend creates a new SQLite backend.
func NewBackend(params *NewBackendParams) (backends.Backend, error) {
pool := newConnPool()
pool := newConnPool(params.Dir)

storage, err := newMetadataStorage(params.Dir, pool)
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion internal/backends/sqlite/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ import (
)

// newConnPool creates a new connection pool.
func newConnPool() *connPool {
func newConnPool(dir string) *connPool {
pool := &connPool{
mx: sync.Mutex{},
dbs: map[string]*sql.DB{},
token: resource.NewToken(),
dir: dir,
}

resource.Track(pool, pool.token)
Expand Down