Skip to content
Closed
Show file tree
Hide file tree
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
16 changes: 10 additions & 6 deletions cmd/fdsn-quake-consumer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ import (
)

const (
healthCheckAged = 5 * time.Minute //need to have a good heartbeat within this time
healthCheckStartup = 5 * time.Minute //ignore heartbeat messages for this time after starting
healthCheckTimeout = 30 * time.Second //health check timeout
healthCheckService = ":7777" //end point to listen to for SOH checks
healthCheckPath = "/soh"
sqs_visibility_timeout = 60 //seconds
healthCheckAged = 5 * time.Minute //need to have a good heartbeat within this time
healthCheckStartup = 5 * time.Minute //ignore heartbeat messages for this time after starting
healthCheckTimeout = 30 * time.Second //health check timeout
healthCheckService = ":7777" //end point to listen to for SOH checks
healthCheckPath = "/soh"
)

var (
Expand Down Expand Up @@ -114,7 +115,7 @@ loop1:
for {
health.Ok() // update soh

r, err = sqsClient.ReceiveWithContext(ctx, queueURL, 600)
r, err = sqsClient.ReceiveWithContext(ctx, queueURL, sqs_visibility_timeout)
if err != nil {
switch {
case sqs.IsNoMessagesError(err):
Expand All @@ -132,6 +133,9 @@ loop1:
err = metrics.DoProcess(&n, []byte(r.Body))
if err != nil {
log.Printf("problem processing message, skipping deletion for redelivery: %s", err)
if err1 := sqsClient.SetMessageVisibility(queueURL, r.ReceiptHandle, 0); err1 != nil {
log.Printf("error changing message visibility: %s", err1.Error())
}
continue
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/GeoNet/fdsn
go 1.23

require (
github.com/GeoNet/kit v0.0.0-20241129025613-745247c4fb1c
github.com/GeoNet/kit v0.0.0-20250803205759-df08ce98e1ed
github.com/gorilla/schema v1.4.1
github.com/joho/godotenv v1.5.1
github.com/lib/pq v1.10.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/GeoNet/kit v0.0.0-20241129025613-745247c4fb1c h1:yrk9pbtLaPEWmmrx2v5U457PnEzIg1o+Q6X0hOZWWS0=
github.com/GeoNet/kit v0.0.0-20241129025613-745247c4fb1c/go.mod h1:O5T12WrCE1SOD52A9Ye//Wjl3HX7BFZv3dXzDz3adMo=
github.com/GeoNet/kit v0.0.0-20250803205759-df08ce98e1ed h1:BzEg8z1uSdNbv/Ivmf6NZAa1WjcbI+YzR9lxVlp8BZE=
github.com/GeoNet/kit v0.0.0-20250803205759-df08ce98e1ed/go.mod h1:XeIegOtPHnYCcsPZjTWMdmcUkUowOmIxVNhlwOlyjhw=
github.com/aws/aws-sdk-go-v2 v1.25.3 h1:xYiLpZTQs1mzvz5PaI6uR0Wh57ippuEthxS4iK5v0n0=
github.com/aws/aws-sdk-go-v2 v1.25.3/go.mod h1:35hUlJVYd+M++iLI3ALmVwMOyRYMmRqUXpTtRGW+K9I=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1 h1:gTK2uhtAPtFcdRRJilZPx8uJLL2J85xK11nKtWL0wfU=
Expand Down
30 changes: 30 additions & 0 deletions vendor/github.com/GeoNet/kit/aws/s3/s3.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading