Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/events/pgevents/pgevents.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,9 @@ func New(ctx context.Context, cfg Config) (*Log, error) {
}

func configureCockroachDBRetention(ctx context.Context, cfg *Config, pool *pgxpool.Pool) error {
// Arbitrary timeout to make sure we don't end up hanging for some reason
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
// The first run of this query on multi region setup can sometimes take more than 5 seconds.
// The subsequent runs are faster (a couple of seconds at most).
ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
defer cancel()

var expiryQuery string
Expand Down