Skip to content

Commit

Permalink
enable session active when calling close()
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jbahk committed Dec 1, 2020
1 parent 931b638 commit c342eb5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,11 @@ func (sc *snowflakeConn) Close() (err error) {
glog.V(2).Infoln("Close")
sc.stopHeartBeat()

err = sc.rest.FuncCloseSession(context.TODO(), sc.rest, sc.rest.RequestTimeout)
if err != nil {
glog.V(2).Info(err)
if !sc.isClientSessionKeepAliveEnabled() {
err = sc.rest.FuncCloseSession(context.TODO(), sc.rest, sc.rest.RequestTimeout)
if err != nil {
glog.V(2).Info(err)
}
}
sc.cleanup()
return nil
Expand Down

0 comments on commit c342eb5

Please sign in to comment.