sqs settings modified
This commit is contained in:
parent
37654cb4ec
commit
6b8db9f2e6
|
@ -175,26 +175,31 @@ class Command(BaseCommand):
|
||||||
print("Started Executin this from conversion")
|
print("Started Executin this from conversion")
|
||||||
queue = sqs.get_queue_by_name(QueueName="mnfqueue")
|
queue = sqs.get_queue_by_name(QueueName="mnfqueue")
|
||||||
# try:
|
# try:
|
||||||
messages = queue.receive_messages(
|
while True:
|
||||||
MessageAttributeNames=["All"],
|
|
||||||
MaxNumberOfMessages=5,
|
|
||||||
WaitTimeSeconds=20,
|
|
||||||
)
|
|
||||||
for msg in messages:
|
|
||||||
try:
|
|
||||||
print("Received message: %s: %s", msg.message_id, msg.body)
|
|
||||||
print(type(msg.body))
|
|
||||||
body_dict = json.loads(msg.body)
|
|
||||||
if body_dict['service_type'] == "conversion":
|
|
||||||
|
|
||||||
run_conversion(msg)
|
messages = queue.receive_messages(
|
||||||
|
MessageAttributeNames=["All"],
|
||||||
|
MaxNumberOfMessages=5,
|
||||||
|
WaitTimeSeconds=10,
|
||||||
|
)
|
||||||
|
if len(messages) > 0:
|
||||||
|
|
||||||
elif body_dict['service_type'] == "audit":
|
for msg in messages:
|
||||||
|
try:
|
||||||
|
print("Received message: %s: %s", msg.message_id, msg.body)
|
||||||
|
print(type(msg.body))
|
||||||
|
body_dict = json.loads(msg.body)
|
||||||
|
if body_dict['service_type'] == "conversion":
|
||||||
|
|
||||||
run_audit(msg)
|
run_conversion(msg)
|
||||||
|
|
||||||
except Exception as error:
|
elif body_dict['service_type'] == "audit":
|
||||||
print("error execution from queue: %s", error)
|
|
||||||
|
|
||||||
|
run_audit(msg)
|
||||||
|
|
||||||
|
except Exception as error:
|
||||||
|
print("error execution from queue: %s", error)
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
|
||||||
print("Completed All Execution")
|
print("Completed All Execution")
|
||||||
|
|
Loading…
Reference in New Issue