Skip to content

Commit

Permalink
Don't heartbeat forever you muppet
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyhb committed Oct 12, 2024
1 parent ae3fafe commit d287ef9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/replicator/pgreplicator/pg.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ func (p *pg) Pull(ctx context.Context, cc chan *changeset.Changeset) error {

t := time.NewTicker(p.heartbeatTime)
for range t.C {
if ctx.Err() != nil {
return
}

// Send a hearbeat every minute
p.queryLock.Lock()
_, err := p.queryConn.Exec(ctx, "SELECT pg_logical_emit_message(false, 'heartbeat', now()::varchar);")
Expand Down

0 comments on commit d287ef9

Please sign in to comment.