summaryrefslogtreecommitdiff
path: root/aws.go
diff options
context:
space:
mode:
authorNick White <git@njw.name>2021-07-13 10:34:26 +0100
committerNick White <git@njw.name>2021-07-13 10:34:26 +0100
commit05fbc6c65c8556d89d8b7fdb645f3ef3b273b5e9 (patch)
treeae1667fbb88de0792b589247cfb4e52adc989808 /aws.go
parent02221d2268579a5858892617b9948ef6470551b5 (diff)
aws: Only look up test queue id when asked for, as for most Init()s it won't be needed
Diffstat (limited to 'aws.go')
-rw-r--r--aws.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/aws.go b/aws.go
index 6e0d7f8..2411c24 100644
--- a/aws.go
+++ b/aws.go
@@ -51,7 +51,6 @@ type AwsConn struct {
downloader *s3manager.Downloader
uploader *s3manager.Uploader
wipequrl, prequrl, ocrpgqurl, analysequrl string
- testqurl string
wipstorageid string
}
@@ -126,15 +125,6 @@ func (a *AwsConn) Init() error {
}
a.analysequrl = *result.QueueUrl
- a.Logger.Println("Getting test queue URL")
- result, err = a.sqssvc.GetQueueUrl(&sqs.GetQueueUrlInput{
- QueueName: aws.String(queueTest),
- })
- if err != nil {
- return errors.New(fmt.Sprintf("Error getting test queue URL: %s", err))
- }
- a.testqurl = *result.QueueUrl
-
return nil
}
@@ -347,7 +337,17 @@ func (a *AwsConn) WIPStorageId() string {
}
func (a *AwsConn) TestQueueId() string {
- return a.testqurl
+ // We don't bother saving the queue id in Init(), as it's only
+ // used for testing
+ a.Logger.Println("Getting test queue URL")
+ result, err := a.sqssvc.GetQueueUrl(&sqs.GetQueueUrlInput{
+ QueueName: aws.String(queueTest),
+ })
+ if err != nil {
+ a.Logger.Printf("Error getting test queue URL: %s\n", err)
+ return ""
+ }
+ return *result.QueueUrl
}
func (a *AwsConn) ListObjects(bucket string, prefix string) ([]string, error) {