From 7693065b8b8a9eff1f17dc993ae1235984872e09 Mon Sep 17 00:00:00 2001 From: Nick White Date: Tue, 19 Nov 2019 14:47:41 +0000 Subject: Add ocrpage queue for processing individual pages This should be a good way to get around the ongoing heartbeat issue, as individual page jobs will never come close to a the 12 hour mark that can cause the bug. The OCR page processing is done and working now, still to do is to populate the queue (rather than the ocr queue) after preprocessing / wiping. --- aws.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'aws.go') diff --git a/aws.go b/aws.go index 73f3b2f..f5ac338 100644 --- a/aws.go +++ b/aws.go @@ -44,6 +44,7 @@ type AwsConn struct { downloader *s3manager.Downloader uploader *s3manager.Uploader wipequrl, prequrl, ocrqurl, analysequrl string + ocrpgqurl string wipstorageid string } @@ -105,6 +106,15 @@ func (a *AwsConn) Init() error { } a.analysequrl = *result.QueueUrl + a.Logger.Println("Getting OCR Page queue URL") + result, err = a.sqssvc.GetQueueUrl(&sqs.GetQueueUrlInput{ + QueueName: aws.String("rescribeocrpage"), + }) + if err != nil { + return errors.New(fmt.Sprintf("Error getting OCR Page queue URL: %s", err)) + } + a.ocrpgqurl = *result.QueueUrl + a.wipstorageid = "rescribeinprogress" return nil @@ -224,6 +234,10 @@ func (a *AwsConn) OCRQueueId() string { return a.ocrqurl } +func (a *AwsConn) OCRPageQueueId() string { + return a.ocrpgqurl +} + func (a *AwsConn) AnalyseQueueId() string { return a.analysequrl } -- cgit v1.2.1-24-ge1ad