You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ from eb_sqs.decorators import task
25
25
26
26
@task(queue_name='test')
27
27
defecho(message):
28
-
printmessage
28
+
print(message)
29
29
30
30
echo.delay(message='Hello World!')
31
31
```
@@ -56,10 +56,10 @@ from eb_sqs.decorators import task
56
56
57
57
@task(queue_name='test', max_retries=5)
58
58
defupload_file(message):
59
-
print'# of retries: {}'.format(upload_file.retry_num)
59
+
print('# of retries: {}'.format(upload_file.retry_num))
60
60
try:
61
61
# upload ...
62
-
expect ConnectionException:
62
+
except ConnectionException:
63
63
upload_file.retry()
64
64
```
65
65
@@ -69,7 +69,7 @@ The retry call supports the `delay` and `execute_inline` arguments in order to d
69
69
70
70
#### Executing Tasks
71
71
72
-
The Elastic Beanstalk Worker Tier sends all tasks to a API endpoint. django-eb-sqs has already such an endpoint which can be used by specifing the url mapping in your `urls.py` file.
72
+
The Elastic Beanstalk Worker Tier sends all tasks to a API endpoint. django-eb-sqs has already such an endpoint which can be used by specifying the url mapping in your `urls.py` file.
Multiple tasks can be grouped by specifing the `group_id` argument when calling `delay` on a task.
117
+
Multiple tasks can be grouped by specifying the `group_id` argument when calling `delay` on a task.
118
118
If all tasks of a specific group are executed then the group callback task specified by `EB_SQS_GROUP_CALLBACK_TASK` is executed.
119
119
120
120
Example calls:
@@ -141,6 +141,8 @@ The following settings can be used to fine tune django-eb-sqs. Copy them into yo
141
141
- EB_SQS_MAX_NUMBER_OF_MESSAGES (`10`): The maximum number of messages to read in a single call from SQS (<= 10).
142
142
- EB_SQS_WAIT_TIME_S (`2`): The time to wait (seconds) when receiving messages from SQS.
143
143
- EB_SQS_AUTO_ADD_QUEUE (`False`): If queues should be added automatically to AWS if they don't exist.
144
+
- EB_SQS_QUEUE_MESSAGE_RETENTION (`1209600`): The value (in seconds) to be passed to MessageRetentionPeriod parameter, when creating a queue (only relevant in case EB_SQS_AUTO_ADD_QUEUE is set to True).
145
+
- EB_SQS_QUEUE_VISIBILITY_TIMEOUT (`300`): The value (in seconds) to be passed to VisibilityTimeout parameter, when creating a queue (only relevant in case EB_SQS_AUTO_ADD_QUEUE is set to True).
144
146
- EB_SQS_DEAD_LETTER_MODE (`False`): Enable if this worker is handling the SQS dead letter queue. Tasks won't be executed but group callback is.
145
147
- EB_SQS_DEFAULT_DELAY (`0`): Default task delay time in seconds.
146
148
- EB_SQS_DEFAULT_MAX_RETRIES (`0`): Default retry limit for all tasks.
0 commit comments