From 7af58584d30f497ee8c6c41c964e8bd084ecd2c9 Mon Sep 17 00:00:00 2001 From: Blaize M Kaye Date: Thu, 27 Jul 2023 10:41:24 +1200 Subject: [PATCH 1/2] Adds new environment var --- main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/main.go b/main.go index fc742fd..b67d8cc 100644 --- a/main.go +++ b/main.go @@ -92,6 +92,7 @@ func main() { s3Region = getEnv("S3_FILES_REGION", s3Region) filterTransformerFile = getEnv("FILTER_TRANSFORMER_FILE", filterTransformerFile) s3useSSL = getEnvBool("S3_USESSL", s3useSSL) + disableAPIIntegration = getEnvBool("INSIGHTS_DISABLE_API_INTEGRATION", disableAPIIntegration) // configure the backup handler settings broker := handler.RabbitBroker{ From 4b359e5c8d5e0b3e394790f55a1cf8fec130ab58 Mon Sep 17 00:00:00 2001 From: Blaize M Kaye Date: Thu, 27 Jul 2023 11:12:04 +1200 Subject: [PATCH 2/2] Fixes double ack and changes Errorf to Printf --- internal/handler/main.go | 10 ++-------- main.go | 1 + 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/internal/handler/main.go b/internal/handler/main.go index 32853a8..2898a00 100644 --- a/internal/handler/main.go +++ b/internal/handler/main.go @@ -295,7 +295,7 @@ func processingIncomingMessageQueueFactory(h *Messaging) func(mq.Message) { // Ack to remove from queue err := message.Ack(false) if err != nil { - fmt.Errorf("%s", err.Error()) + fmt.Printf("Failed to acknowledge message: %s\n", err.Error()) } }(message) @@ -376,7 +376,7 @@ func processingIncomingMessageQueueFactory(h *Messaging) func(mq.Message) { } err := message.Reject(false) if err != nil { - fmt.Errorf("%s", err.Error()) + fmt.Printf("Unable to reject payload: %s\n", err.Error()) } return } @@ -417,12 +417,6 @@ func processingIncomingMessageQueueFactory(h *Messaging) func(mq.Message) { } } } - - // Ack to remove from queue - err := message.Ack(false) - if err != nil { - fmt.Errorf("%s", err.Error()) - } } } diff --git a/main.go b/main.go index b67d8cc..40de93d 100644 --- a/main.go +++ b/main.go @@ -93,6 +93,7 @@ func main() { filterTransformerFile = getEnv("FILTER_TRANSFORMER_FILE", filterTransformerFile) s3useSSL = getEnvBool("S3_USESSL", s3useSSL) disableAPIIntegration = getEnvBool("INSIGHTS_DISABLE_API_INTEGRATION", disableAPIIntegration) + disableS3Upload = getEnvBool("INSIGHTS_DISABLE_S3_UPLOAD", disableS3Upload) // configure the backup handler settings broker := handler.RabbitBroker{