Skip to content

Commit

Permalink
chore(lib): fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielcorado committed Dec 23, 2024
1 parent dfc3a48 commit bc76a1b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/auth/auth_with_roles_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2322,7 +2322,7 @@ func TestStreamSessionEvents_SessionType(t *testing.T) {
require.NoError(t, stream.Complete(ctx))

accessedFormat := teleport.PTY
clt.StreamSessionEvents(metadata.WithSessionRecordingFormatContext(ctx, accessedFormat), session.ID(sessionID), 0)
clt.StreamSessionEvents(metadata.WithSessionRecordingFormatContext(ctx, accessedFormat), sessionID, 0)

// Perform the listing an eventually loop to ensure the event is emitted.
var searchEvents []apievents.AuditEvent
Expand Down
14 changes: 6 additions & 8 deletions lib/events/auditlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,15 +512,13 @@ func (l *AuditLog) StreamSessionEvents(ctx context.Context, sessionID session.ID
sessionStartCh := make(chan apievents.AuditEvent, 1)
if startCb, err := SessionStartCallbackFromContext(ctx); err == nil {
go func() {
select {
case evt, ok := <-sessionStartCh:
if !ok {
startCb(nil, trace.NotFound("session start event not found"))
return
}

startCb(evt, nil)
evt, ok := <-sessionStartCh
if !ok {
startCb(nil, trace.NotFound("session start event not found"))
return
}

startCb(evt, nil)
}()
}

Expand Down

0 comments on commit bc76a1b

Please sign in to comment.