MCPcopy Index your code
hub / github.com/cortexlabs/cortex / createFIFOQueue

Function createFIFOQueue

pkg/operator/resources/asyncapi/queue.go:30–54  ·  view source on GitHub ↗
(apiName string, initialDeploymentTime int64, tags map[string]string)

Source from the content-addressed store, hash-verified

28)
29
30func createFIFOQueue(apiName string, initialDeploymentTime int64, tags map[string]string) (string, error) {
31 for key, value := range config.ClusterConfig.Tags {
32 tags[key] = value
33 }
34
35 queueName := apiQueueName(apiName, initialDeploymentTime)
36
37 attributes := map[string]string{
38 sqs.QueueAttributeNameFifoQueue: "true",
39 sqs.QueueAttributeNameVisibilityTimeout: "60",
40 }
41
42 output, err := config.AWS.SQS().CreateQueue(
43 &sqs.CreateQueueInput{
44 Attributes: aws.StringMap(attributes),
45 QueueName: aws.String(queueName),
46 Tags: aws.StringMap(tags),
47 },
48 )
49 if err != nil {
50 return "", errors.Wrap(err, "failed to create sqs queue", queueName)
51 }
52
53 return *output.QueueUrl, nil
54}
55
56func apiQueueName(apiName string, initialDeploymentTime int64) string {
57 // initialDeploymentTime is incorporated so that the queue name changes when doing a deploy after a delete

Callers 1

UpdateAPIFunction · 0.85

Calls 4

WrapFunction · 0.92
apiQueueNameFunction · 0.85
SQSMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected