Skip to content

Commit af5168f

Browse files
committed
last session usage initialization
1 parent 764d62b commit af5168f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

internal/table/session.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,10 @@ func newSession(ctx context.Context, cc grpc.ClientConnInterface, config config.
142142
}
143143

144144
s = &session{
145-
id: result.GetSessionId(),
146-
config: config,
147-
status: table.SessionReady,
145+
id: result.GetSessionId(),
146+
config: config,
147+
status: table.SessionReady,
148+
lastUsage: time.Now().Unix(),
148149
}
149150

150151
s.tableService = Ydb_Table_V1.NewTableServiceClient(
@@ -185,8 +186,7 @@ func (s *session) Close(ctx context.Context) (err error) {
185186
onDone := trace.TableOnSessionDelete(s.config.Trace(), &ctx, s)
186187

187188
if time.Since(s.LastUsage()) < s.config.IdleThreshold() {
188-
_, err = s.tableService.DeleteSession(
189-
ctx,
189+
_, err = s.tableService.DeleteSession(ctx,
190190
&Ydb_Table.DeleteSessionRequest{
191191
SessionId: s.id,
192192
OperationParams: operation.Params(ctx,

0 commit comments

Comments
 (0)