Skip to content

Commit e6c4bc4

Browse files
committed
Merge branch '260-reset-connection' into 'master'
fix: re-init connection on reset (platform#260) See merge request postgres-ai/joe!178
2 parents 2fbaaae + 1bcad43 commit e6c4bc4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/bot/command/reset_session.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ func ResetSession(ctx context.Context, cmd *platform.Command, msg *models.Messag
5050
idleConnection.Release()
5151
}
5252

53+
cloneConn, err := session.Pool.Acquire(ctx)
54+
if err != nil {
55+
log.Err("failed to acquire database connection:", err)
56+
}
57+
58+
if cloneConn != nil {
59+
session.CloneConnection = cloneConn.Conn()
60+
}
61+
5362
fwData := &foreword.Content{
5463
SessionID: clone.ID,
5564
Duration: time.Duration(clone.Metadata.MaxIdleMinutes) * time.Minute,

0 commit comments

Comments
 (0)