Skip to content

Commit

Permalink
Merge pull request #1692 from seiyab/close-datstore-client
Browse files Browse the repository at this point in the history
close datastore.Client
  • Loading branch information
haya14busa committed Apr 8, 2024
2 parents dd1167b + df8f4a1 commit d694c56
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doghouse/server/storage/installation.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func (g *GitHubInstallationDatastore) Put(ctx context.Context, inst *GitHubInsta
if err != nil {
return err
}
defer d.Close()
_, err = d.RunInTransaction(ctx, func(t *datastore.Transaction) error {
var foundInst GitHubInstallation
var ok bool
Expand Down Expand Up @@ -68,6 +69,7 @@ func (g *GitHubInstallationDatastore) Get(ctx context.Context, accountName strin
if err != nil {
return false, nil, err
}
defer d.Close()
if err := d.Get(ctx, key, inst); err != nil {
if err == datastore.ErrNoSuchEntity {
return false, nil, nil
Expand Down
2 changes: 2 additions & 0 deletions doghouse/server/storage/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func (g *GitHubRepoTokenDatastore) Put(ctx context.Context, token *GitHubReposit
if err != nil {
return err
}
defer d.Close()
_, err = d.Put(ctx, key, token)
return err
}
Expand All @@ -55,6 +56,7 @@ func (g *GitHubRepoTokenDatastore) Get(ctx context.Context, owner, repo string)
if err != nil {
return false, nil, err
}
defer d.Close()
if err := d.Get(ctx, key, token); err != nil {
if err == datastore.ErrNoSuchEntity {
return false, nil, nil
Expand Down

0 comments on commit d694c56

Please sign in to comment.