Skip to content

Commit 8726359

Browse files
committed
Add delay before restart for now
1 parent 046a4ff commit 8726359

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

internal/auditlog/tail.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"io"
88
"log/slog"
99
"strings"
10+
"time"
1011

1112
logging "cloud.google.com/go/logging/apiv2"
1213
"cloud.google.com/go/logging/apiv2/loggingpb"
@@ -35,6 +36,7 @@ func Tail(ctx context.Context, projectID, clusterName string, cb func(*audit.Aud
3536
// "rpc error: code = OutOfRange desc = Session has run for the maximum allowed duration of 1h. To
3637
// continue, start a new session with the same request"
3738
slog.Warn("session expired, restarting", slog.Any("error", err))
39+
time.Sleep(time.Second * 5)
3840
continue
3941
}
4042
return fmt.Errorf("log tailing failed: %w", err)

0 commit comments

Comments
 (0)