Skip to content

Commit

Permalink
Adjust timeouts for sqs (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
spoonscen authored and fterrag committed Oct 15, 2019
1 parent 7f0e201 commit f5e0a2b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $ docker run -e AWS_ACCESS_KEY_ID=your-access-id AWS_SECRET_ACCESS_KEY=your-secr
|`SQSD_QUEUE_URL`||yes|The URL of the SQS queue.|
|`SQSD_QUEUE_MAX_MSGS`|`10`|no|Max number of messages a worker should try to receive from the SQS queue.|
|`SQSD_QUEUE_WAIT_TIME`|`10`|no|Number of seconds for SQS to wait until a message is available in the queue before sending a response.|
|`SQSD_HTTP_MAX_CONNS`|`50`|no|Maximum number of concurrent HTTP requests to make to SQSD_HTTP_URL.|
|`SQSD_HTTP_MAX_CONNS`|`25`|no|Maximum number of concurrent HTTP requests to make to SQSD_HTTP_URL.|
|`SQSD_HTTP_URL`||yes|The URL of your service to make a request to.|
|`SQSD_HTTP_CONTENT_TYPE` ||no|The value to send for the HTTP header `Content-Type` when making a request to your service.|
|`SQSD_AWS_ENDPOINT` ||no|Sets the AWS endpoint.|
Expand All @@ -33,8 +33,8 @@ $ docker run -e AWS_ACCESS_KEY_ID=your-access-id AWS_SECRET_ACCESS_KEY=your-secr
|`SQSD_HTTP_HEALTH_WAIT`|`5`|no|How long to wait before starting health checks|
|`SQSD_HTTP_HEALTH_INTERVAL`|`5`|no|How often to wait between health checks|
|`SQSD_HTTP_HEALTH_SUCCESS_COUNT`|`1`|no|How many successful health checks required in a row|
|`SQSD_HTTP_TIMEOUT`|`5`|no|Number of seconds to wait for a response from the worker|
|`SQSD_SQS_HTTP_TIMEOUT`|`5`|no|Number of seconds to wait for a response from sqs|
|`SQSD_HTTP_TIMEOUT`|`15`|no|Number of seconds to wait for a response from the worker|
|`SQSD_SQS_HTTP_TIMEOUT`|`15`|no|Number of seconds to wait for a response from sqs|
|`SQSD_HTTP_SSL_VERIFY`|`true`|no|Enable SSL Verification on the URL of your service to make a request to (if you're using self-signed certificate)|

## HMAC
Expand Down
6 changes: 3 additions & 3 deletions cmd/simplesqsd/simplesqsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,21 @@ func main() {
c.QueueMaxMessages = getEnvInt("SQSD_QUEUE_MAX_MSGS", 10)
c.QueueWaitTime = getEnvInt("SQSD_QUEUE_WAIT_TIME", 10)

c.HTTPMaxConns = getEnvInt("SQSD_HTTP_MAX_CONNS", 50)
c.HTTPMaxConns = getEnvInt("SQSD_HTTP_MAX_CONNS", 25)
c.HTTPURL = os.Getenv("SQSD_HTTP_URL")
c.HTTPContentType = os.Getenv("SQSD_HTTP_CONTENT_TYPE")

c.HTTPHealthPath = os.Getenv("SQSD_HTTP_HEALTH_PATH")
c.HTTPHealthWait = getEnvInt("SQSD_HTTP_HEALTH_WAIT", 5)
c.HTTPHealthInterval = getEnvInt("SQSD_HTTP_HEALTH_INTERVAL", 5)
c.HTTPHealthSucessCount = getEnvInt("SQSD_HTTP_HEALTH_SUCCESS_COUNT", 1)
c.HTTPTimeout = getEnvInt("SQSD_HTTP_TIMEOUT", 5)
c.HTTPTimeout = getEnvInt("SQSD_HTTP_TIMEOUT", 15)

c.AWSEndpoint = os.Getenv("SQSD_AWS_ENDPOINT")
c.HTTPHMACHeader = os.Getenv("SQSD_HTTP_HMAC_HEADER")
c.HMACSecretKey = []byte(os.Getenv("SQSD_HMAC_SECRET_KEY"))

c.SQSHTTPTimeout = getEnvInt("SQSD_SQS_HTTP_TIMEOUT", 5)
c.SQSHTTPTimeout = getEnvInt("SQSD_SQS_HTTP_TIMEOUT", 15)
c.SSLVerify = getenvBool("SQSD_HTTP_SSL_VERIFY", true)

if len(c.QueueRegion) == 0 {
Expand Down

0 comments on commit f5e0a2b

Please sign in to comment.