Skip to content
/ dance Public
forked from FerretDB/dance

Commit

Permalink
Add TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekSi committed Dec 23, 2024
1 parent 98a1eb0 commit 7b9dbe5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/dance/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ func main() {
}

if pusherClient != nil {
// TODO https://github.com/FerretDB/dance/issues/1122
if err = pusherClient.Push(ctx, cf, db, cmp.Passed); err != nil {
log.Fatal(err)
}
Expand Down
4 changes: 4 additions & 0 deletions internal/pusher/pusher.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ func New(uri string, l *slog.Logger) (*Client, error) {
}

// ping pings the database until connection is established or ctx is canceled.
//
// TODO https://github.com/FerretDB/dance/issues/1122
func (c *Client) ping(ctx context.Context) {
for ctx.Err() == nil {
pingCtx, pingCancel := context.WithTimeout(ctx, 5*time.Second)
Expand Down Expand Up @@ -154,6 +156,8 @@ func (c *Client) Push(ctx context.Context, config, database string, res map[stri
}

// Close closes all connections.
//
// TODO https://github.com/FerretDB/dance/issues/1122
func (c *Client) Close() {
c.pingerCancel()
<-c.pingerDone
Expand Down

0 comments on commit 7b9dbe5

Please sign in to comment.