From a1949d8c18baf5dee20ecb7ec40b16c788509070 Mon Sep 17 00:00:00 2001 From: Ilian Aleixev Date: Thu, 25 Apr 2024 12:40:43 -0500 Subject: [PATCH] Add println to client.execute for debug purposes --- CHANGELOG.md | 7 +++++-- rai/client.go | 7 ++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9823db..97b54e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/rai/client.go b/rai/client.go index b181258..2160a81 100644 --- a/rai/client.go +++ b/rai/client.go @@ -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)) return rsp, nil // fast path } id := rsp.Transaction.ID @@ -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)) return rsp, nil } - delta := time.Since(t0) // total run time + fmt.Println(fmt.Sprintf("Txn %s state: %s.", id, rsp.Transaction.State)) + 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) } }