Skip to content

Commit

Permalink
trigger replay on clear
Browse files Browse the repository at this point in the history
marhaupe committed Oct 11, 2024

Unverified

This user has not yet uploaded their public signing key.
1 parent 94f037d commit a05dcbc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/cli/internal/logs/logs.go
Original file line number Diff line number Diff line change
@@ -71,14 +71,15 @@ func (s *LogService) EventHandler() iris.Handler {

func (s *LogService) ClearHandler() iris.Handler {
return func(ctx iris.Context) {
s.logs = make([]Log, 0)
for key, entry := range s.sessions.Items() {
session, ok := entry.Object.(Session)
if ok && session.after != "" {
session.after = ""
s.sessions.Set(key, session, cache.NoExpiration)
}
s.replay(key)
}
s.logs = make([]Log, 0)
ctx.StatusCode(iris.StatusOK)
ctx.WriteString("OK")
}
@@ -127,7 +128,7 @@ func (s *LogService) replay(token string) error {
if !ok {
return fmt.Errorf("session is not of type session")
}
var processedLogs []Log
processedLogs := make([]Log, 0)
for _, l := range s.logs {
if session.after != "" && l.ID == session.after {
processedLogs = make([]Log, 0)

0 comments on commit a05dcbc

Please sign in to comment.