diff options
author | Valery Piashchynski <[email protected]> | 2021-07-23 20:50:24 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-07-23 20:50:24 +0300 |
commit | c61756635c0d1b25b304627c8a693f2e9e2ee4b3 (patch) | |
tree | a10857e07a2d58a1d2ff602974de04f3bfbee6f6 /plugins/jobs/drivers/sqs | |
parent | e88dfd5cd10662f0ad68e69f9d9de2f66ddf26d0 (diff) |
SQS initial durability test
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/jobs/drivers/sqs')
-rw-r--r-- | plugins/jobs/drivers/sqs/consumer.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/jobs/drivers/sqs/consumer.go b/plugins/jobs/drivers/sqs/consumer.go index f6311715..08a6170e 100644 --- a/plugins/jobs/drivers/sqs/consumer.go +++ b/plugins/jobs/drivers/sqs/consumer.go @@ -256,9 +256,12 @@ func (j *JobConsumer) Push(jb *job.Job) error { msg := fromJob(jb) + // 10 seconds deadline to make a request TODO ??? + ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(time.Second*10)) + defer cancel() // The new value for the message's visibility timeout (in seconds). Values range: 0 // to 43200. Maximum: 12 hours. - _, err := j.client.SendMessage(context.Background(), msg.pack(j.queueURL)) + _, err := j.client.SendMessage(ctx, msg.pack(j.queueURL)) if err != nil { return errors.E(op, err) } |