Skip to content

Commit

Permalink
Add println to client.execute for debug purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
Akrion committed Apr 25, 2024
1 parent 4614e6d commit a1949d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Changelog

## v0.5.13-alpha
* Added print outs for client.execute.

## v0.5.12-alpha
* Add beta version of snowflake datastream APIs.
* Add beta version of snowflake datastream APIs.

## v0.5.11-alpha
* Add ability to start and stop engines.
* Add ability to start and stop engines.

## v0.5.10-alpha
* `X-Request-Id` is generated for every HTTP request.
Expand Down
7 changes: 6 additions & 1 deletion rai/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,7 @@ func (c *Client) Execute(
return nil, err
}
if isTransactionComplete(&rsp.Transaction) {
fmt.Println(fmt.Sprintf("Txn state: %s.", rsp.Transaction.State))

Check failure on line 977 in rai/client.go

View workflow job for this annotation

GitHub Actions / lint

S1038: should use fmt.Printf instead of fmt.Println(fmt.Sprintf(...)) (but don't forget the newline) (gosimple)
return rsp, nil // fast path
}
id := rsp.Transaction.ID
Expand All @@ -985,13 +986,17 @@ func (c *Client) Execute(
return nil, err
}
if isTransactionComplete(&rsp.Transaction) {
fmt.Println(fmt.Sprintf("Txn %s state: %s.", id, rsp.Transaction.State))

Check failure on line 989 in rai/client.go

View workflow job for this annotation

GitHub Actions / lint

S1038: should use fmt.Printf instead of fmt.Println(fmt.Sprintf(...)) (but don't forget the newline) (gosimple)
return rsp, nil
}
delta := time.Since(t0) // total run time
fmt.Println(fmt.Sprintf("Txn %s state: %s.", id, rsp.Transaction.State))

Check failure on line 992 in rai/client.go

View workflow job for this annotation

GitHub Actions / lint

S1038: should use fmt.Printf instead of fmt.Println(fmt.Sprintf(...)) (but don't forget the newline) (gosimple)
delta := time.Since(t0) // total run time
fmt.Println(fmt.Sprintf("Delta is %s.", delta))
pause := time.Duration(int64(delta) / 5) // 20% of total run time
if pause > twoMinutes {
pause = twoMinutes
}
fmt.Println(fmt.Sprintf("Pause took %s.", pause))
time.Sleep(pause)
}
}
Expand Down

0 comments on commit a1949d8

Please sign in to comment.