From ffbda7e158e21b2889b1726ae398f3822a3f51df Mon Sep 17 00:00:00 2001 From: Nick White Date: Mon, 28 Oct 2019 15:51:44 +0000 Subject: Try to fix heartbeat renew issue more fully This approach first sets the remaining visibility timeout to zero. This should ensure that the message is available to re-find as soon as the process looks for it. Correspondingly the delay between checks is much shorter, as there shouldn't be a reason for much delay. --- cmd/bookpipeline/main.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cmd') diff --git a/cmd/bookpipeline/main.go b/cmd/bookpipeline/main.go index 2179549..f7da588 100644 --- a/cmd/bookpipeline/main.go +++ b/cmd/bookpipeline/main.go @@ -255,6 +255,10 @@ func heartbeat(conn Pipeliner, t *time.Ticker, msg bookpipeline.Qmsg, queue stri for range t.C { m, err := conn.QueueHeartbeat(currentmsg, queue, HeartbeatTime*2) if err != nil { + // TODO: would be better to ensure this error stops any running + // processes, as they will ultimately fail in the case of + // it. could do this by setting a global variable that + // processes check each time they loop. errc <- err t.Stop() return -- cgit v1.2.1-24-ge1ad