Skip to content

Commit

Permalink
Increase pgevents TTL setting query timeout (#49469)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoShaka authored Nov 26, 2024
1 parent 13a1ad0 commit 9b6e82a
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit 9b6e82a

Please sign in to comment.