feat(queue-url): ExternalURLBase для публичного QueueUrl (+ env SHARED_SQS_EXTERNAL_URL_BASE), тест
This commit is contained in:
@@ -67,6 +67,11 @@ func LoadYamlConfig(filename string, env string) []string {
|
||||
|
||||
models.CurrentEnvironment = envs[env]
|
||||
|
||||
// Публичный адрес очередей (напр. https://sqs.sinefo.ru) — override через env.
|
||||
if v := os.Getenv("SHARED_SQS_EXTERNAL_URL_BASE"); v != "" {
|
||||
models.CurrentEnvironment.ExternalURLBase = v
|
||||
}
|
||||
|
||||
if envs[env].Port != "" {
|
||||
ports = []string{envs[env].Port}
|
||||
}
|
||||
@@ -90,6 +95,9 @@ func LoadYamlConfig(filename string, env string) []string {
|
||||
queueUrl = "http://" + models.CurrentEnvironment.Region + "." + models.CurrentEnvironment.Host + ":" +
|
||||
models.CurrentEnvironment.Port + "/" + models.CurrentEnvironment.AccountID + "/" + queue.Name
|
||||
}
|
||||
if base := strings.TrimRight(models.CurrentEnvironment.ExternalURLBase, "/"); base != "" {
|
||||
queueUrl = base + "/" + models.CurrentEnvironment.AccountID + "/" + queue.Name
|
||||
}
|
||||
queueArn := "arn:aws:sqs:" + models.CurrentEnvironment.Region + ":" + models.CurrentEnvironment.AccountID + ":" + queue.Name
|
||||
|
||||
if queue.ReceiveMessageWaitTimeSeconds == 0 {
|
||||
|
||||
Reference in New Issue
Block a user