Skip to content

Commit 4ad7dc3

Browse files
author
Alexey Tsitkin
committed
cleanup
1 parent cf84b94 commit 4ad7dc3

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

eb_sqs/worker/service.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import absolute_import, unicode_literals
22

33
from datetime import timedelta, datetime
4-
from time import sleep
54

65
import boto3
76
import logging
@@ -101,16 +100,11 @@ def poll_messages(self, queue):
101100
def process_message(self, msg, worker):
102101
# type: (Message, Worker) -> None
103102
logger.debug('[django-eb-sqs] Read message {}'.format(msg.message_id))
104-
print(msg)
105-
if msg.attributes:
106-
print('Retry number {}'.format(msg.attributes.get('ApproximateReceiveCount', 0)))
107-
sleep(10)
108-
109-
# try:
110-
# worker.execute(msg.body)
111-
# logger.debug('[django-eb-sqs] Processed message {}'.format(msg.message_id))
112-
# except Exception as exc:
113-
# logger.error('[django-eb-sqs] Unhandled error: {}'.format(exc), exc_info=1)
103+
try:
104+
worker.execute(msg.body)
105+
logger.debug('[django-eb-sqs] Processed message {}'.format(msg.message_id))
106+
except Exception as exc:
107+
logger.error('[django-eb-sqs] Unhandled error: {}'.format(exc), exc_info=1)
114108

115109
def get_queues_by_names(self, sqs, queue_names):
116110
# type: (ServiceResource, list) -> list

0 commit comments

Comments
 (0)