From 21d49b546a27de6c53d8fe7d1a68d5a3b5506c93 Mon Sep 17 00:00:00 2001 From: Nick White Date: Mon, 28 Feb 2022 16:17:35 +0000 Subject: Add PreNoWipe queue, that just does binarisation but no wiping --- aws.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'aws.go') diff --git a/aws.go b/aws.go index 0ca657f..b954951 100644 --- a/aws.go +++ b/aws.go @@ -52,6 +52,7 @@ type AwsConn struct { uploader *s3manager.Uploader wipequrl string prequrl string + prenwqurl string ocrpgqurl string analysequrl string testqurl string @@ -102,6 +103,15 @@ func (a *AwsConn) Init() error { } a.prequrl = *result.QueueUrl + a.Logger.Println("Getting preprocess no wipe queue URL") + result, err = a.sqssvc.GetQueueUrl(&sqs.GetQueueUrlInput{ + QueueName: aws.String(queuePreNoWipe), + }) + if err != nil { + return errors.New(fmt.Sprintf("Error getting preprocess no wipe queue URL: %s", err)) + } + a.prenwqurl = *result.QueueUrl + a.Logger.Println("Getting wipeonly queue URL") result, err = a.sqssvc.GetQueueUrl(&sqs.GetQueueUrlInput{ QueueName: aws.String(queueWipeOnly), @@ -337,6 +347,10 @@ func (a *AwsConn) PreQueueId() string { return a.prequrl } +func (a *AwsConn) PreNoWipeQueueId() string { + return a.prenwqurl +} + func (a *AwsConn) WipeQueueId() string { return a.wipequrl } @@ -616,7 +630,7 @@ func (a *AwsConn) Log(v ...interface{}) { // TODO: also set up the necessary security group and iam stuff func (a *AwsConn) MkPipeline() error { buckets := []string{storageWip} - queues := []string{queuePreProc, queueWipeOnly, queueAnalyse, queueOcrPage, queueTest} + queues := []string{queuePreProc, queuePreNoWipe, queueWipeOnly, queueAnalyse, queueOcrPage, queueTest} for _, bucket := range buckets { err := a.CreateBucket(bucket) -- cgit v1.2.1-24-ge1ad