From 90824fa96398418222f85aabfd766f246f36cef0 Mon Sep 17 00:00:00 2001 From: Viet Anh Nguyen Date: Thu, 14 Dec 2023 13:26:16 +0700 Subject: [PATCH] Skip confirming publish rabitmq --- cope2n-ai-fi/celery_worker/client_connector.py | 2 +- cope2n-ai-fi/celery_worker/client_connector_fi.py | 2 +- cope2n-ai-fi/celery_worker/worker.py | 2 +- cope2n-ai-fi/celery_worker/worker_fi.py | 2 +- cope2n-api/fwd_api/celery_worker/client_connector.py | 2 +- cope2n-api/fwd_api/celery_worker/worker.py | 2 +- speedtest_sync.py | 10 +++++----- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cope2n-ai-fi/celery_worker/client_connector.py b/cope2n-ai-fi/celery_worker/client_connector.py index 01b5247..6b76570 100755 --- a/cope2n-ai-fi/celery_worker/client_connector.py +++ b/cope2n-ai-fi/celery_worker/client_connector.py @@ -22,7 +22,7 @@ class CeleryConnector: app = Celery( "postman", broker=env.str("CELERY_BROKER", "amqp://test:test@rabbitmq:5672"), - broker_transport_options={'confirm_publish': True}, + broker_transport_options={'confirm_publish': False}, ) def process_id_result(self, args): diff --git a/cope2n-ai-fi/celery_worker/client_connector_fi.py b/cope2n-ai-fi/celery_worker/client_connector_fi.py index dfbc5ab..c400ceb 100755 --- a/cope2n-ai-fi/celery_worker/client_connector_fi.py +++ b/cope2n-ai-fi/celery_worker/client_connector_fi.py @@ -19,7 +19,7 @@ class CeleryConnector: app = Celery( "postman", broker= env.str("CELERY_BROKER", "amqp://test:test@rabbitmq:5672"), - broker_transport_options={'confirm_publish': True}, + broker_transport_options={'confirm_publish': False}, ) # mock task for FI diff --git a/cope2n-ai-fi/celery_worker/worker.py b/cope2n-ai-fi/celery_worker/worker.py index 0be7421..75e5f71 100755 --- a/cope2n-ai-fi/celery_worker/worker.py +++ b/cope2n-ai-fi/celery_worker/worker.py @@ -12,7 +12,7 @@ app: Celery = Celery( include=[ "celery_worker.mock_process_tasks", ], - broker_transport_options={'confirm_publish': True}, + broker_transport_options={'confirm_publish': False}, ) task_exchange = Exchange("default", type="direct") task_create_missing_queues = False diff --git a/cope2n-ai-fi/celery_worker/worker_fi.py b/cope2n-ai-fi/celery_worker/worker_fi.py index d1c8eec..5a0c278 100755 --- a/cope2n-ai-fi/celery_worker/worker_fi.py +++ b/cope2n-ai-fi/celery_worker/worker_fi.py @@ -11,7 +11,7 @@ app: Celery = Celery( include=[ "celery_worker.mock_process_tasks_fi", ], - broker_transport_options={'confirm_publish': True}, + broker_transport_options={'confirm_publish': False}, ) task_exchange = Exchange("default", type="direct") task_create_missing_queues = False diff --git a/cope2n-api/fwd_api/celery_worker/client_connector.py b/cope2n-api/fwd_api/celery_worker/client_connector.py index a95a9ca..10557ed 100755 --- a/cope2n-api/fwd_api/celery_worker/client_connector.py +++ b/cope2n-api/fwd_api/celery_worker/client_connector.py @@ -37,7 +37,7 @@ class CeleryConnector: app = Celery( 'postman', broker=settings.BROKER_URL, - broker_transport_options={'confirm_publish': True}, + broker_transport_options={'confirm_publish': False}, ) def do_pdf(self, args): return self.send_task('do_pdf', args) diff --git a/cope2n-api/fwd_api/celery_worker/worker.py b/cope2n-api/fwd_api/celery_worker/worker.py index 5867612..70d302c 100755 --- a/cope2n-api/fwd_api/celery_worker/worker.py +++ b/cope2n-api/fwd_api/celery_worker/worker.py @@ -13,7 +13,7 @@ app: Celery = Celery( 'postman', broker=settings.BROKER_URL, include=['fwd_api.celery_worker.process_result_tasks', 'fwd_api.celery_worker.internal_task'], - broker_transport_options={'confirm_publish': True}, + broker_transport_options={'confirm_publish': False}, ) app.conf.update({ diff --git a/speedtest_sync.py b/speedtest_sync.py index 9c90371..0a4a629 100644 --- a/speedtest_sync.py +++ b/speedtest_sync.py @@ -94,14 +94,14 @@ def process_file(data): -invoice_files = [ - ('invoice_file', ('invoice.pdf', open("test_samples/20220303025923NHNE_20220222_Starhub_Order_Confirmation_by_Email.pdf", "rb").read())), -] # invoice_files = [ -# ('invoice_file', ('invoice.jpg', open("test_samples/sbt/invoice.jpg", "rb").read())), +# ('invoice_file', ('invoice.pdf', open("test_samples/20220303025923NHNE_20220222_Starhub_Order_Confirmation_by_Email.pdf", "rb").read())), # ] +invoice_files = [ + ('invoice_file', ('invoice.jpg', open("test_samples/sbt/invoice.jpg", "rb").read())), +] imei_files = [ - ('imei_files', ("test_samples/sbt/imei1.jpg", open("test_samples/sbt/invoice.jpg", "rb").read())), + ('imei_files', ("test_samples/sbt/imei1.jpg", open("test_samples/sbt/imei1.jpg", "rb").read())), ('imei_files', ("test_samples/sbt/imei2.jpg", open("test_samples/sbt/imei2.jpg", "rb").read())), ('imei_files', ("test_samples/sbt/imei3.jpg", open("test_samples/sbt/imei3.jpg", "rb").read())), ('imei_files', ("test_samples/sbt/imei4.jpeg", open("test_samples/sbt/imei4.jpeg", "rb").read())),