Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6bdf3be

Browse files
committed
dbmem
1 parent cf39fd7 commit 6bdf3be

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

coderd/database/dbmem/dbmem.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12277,16 +12277,17 @@ func (q *FakeQuerier) UpsertConnectionLog(_ context.Context, arg database.Upsert
1227712277
q.mutex.Lock()
1227812278
defer q.mutex.Unlock()
1227912279

12280-
if arg.ConnectionAction == "disconnect" {
12281-
for i, existing := range q.connectionLogs {
12282-
if existing.ConnectionID == arg.ConnectionID &&
12283-
existing.WorkspaceID == arg.WorkspaceID &&
12284-
existing.AgentName == arg.AgentName {
12285-
// Update existing connection with close time and reason
12286-
q.connectionLogs[i].CloseTime = sql.NullTime{Valid: true, Time: arg.Time}
12287-
q.connectionLogs[i].CloseReason = arg.CloseReason
12280+
for i, existing := range q.connectionLogs {
12281+
if existing.ConnectionID == arg.ConnectionID &&
12282+
existing.WorkspaceID == arg.WorkspaceID &&
12283+
existing.AgentName == arg.AgentName {
12284+
if arg.ConnectionAction != "disconnect" {
1228812285
return q.connectionLogs[i], nil
1228912286
}
12287+
// Update existing connection with close time and reason
12288+
q.connectionLogs[i].CloseTime = sql.NullTime{Valid: true, Time: arg.Time}
12289+
q.connectionLogs[i].CloseReason = arg.CloseReason
12290+
return q.connectionLogs[i], nil
1229012291
}
1229112292
}
1229212293

0 commit comments

Comments
 (0)